import math
N, K = map(int,input().rstrip().split())
A = list(map(int,input().rstrip().split()))
maxX = max(A)
minX = 0
X = (maxX + minX)//2

while X!=minX:
    num = sum([math.ceil(A[i]/X)-1 for i in range(N)])
    if num<=K:
        maxX = X
    else:
        minX = X
    X = (maxX + minX)//2
num = sum([math.ceil(A[i]/maxX)-1 for i in range(N)])
if num<=K:
    print(maxX)
else:
    print(minX) import math math N, K = map(int,input().rstrip().split()) N map(int,input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split K A = list(map(int,input().rstrip().split())) A list(map(int,input().rstrip().split())) list map(int,input().rstrip().split()) map int input().rstrip().split() ().rstrip().split ().rstrip() ().rstrip () input rstrip split maxX = max(A) maxX max(A) max A minX = 0 minX 0 X = (maxX + minX)//2 X (maxX + minX)//2 maxX + minX maxX minX 2 while X!=minX:
    num = sum([math.ceil(A[i]/X)-1 for i in range(N)])
    if num<=K:
        maxX = X
    else:
        minX = X
    X = (maxX + minX)//2 X!=minX X minX math.ceil(A[i]/X)-1 for i in range(N) for i in range(N) i range(N) range N for i in range(N) math.ceil(A[i]/X)-1 math.ceil(A[i]/X) math.ceil math ceil A[i]/X A[i] A i X 1 num = sum([math.ceil(A[i]/X)-1 for i in range(N)]) num sum([math.ceil(A[i]/X)-1 for i in range(N)]) sum [math.ceil(A[i]/X)-1 for i in range(N)] if num<=K:
        maxX = X
    else:
        minX = X
     num<=K num K maxX = X maxX X minX = X minX X X = (maxX + minX)//2 X (maxX + minX)//2 maxX + minX maxX minX 2 math.ceil(A[i]/maxX)-1 for i in range(N) for i in range(N) i range(N) range N for i in range(N) math.ceil(A[i]/maxX)-1 math.ceil(A[i]/maxX) math.ceil math ceil A[i]/maxX A[i] A i maxX 1 num = sum([math.ceil(A[i]/maxX)-1 for i in range(N)]) num sum([math.ceil(A[i]/maxX)-1 for i in range(N)]) sum [math.ceil(A[i]/maxX)-1 for i in range(N)] if num<=K:
    print(maxX)
else:
    print(minX) num<=K num K print(maxX) print maxX print(minX) print minX minX = X X minX N, K = map(int,input().rstrip().split()) map(int,input().rstrip().split()) N num = sum([math.ceil(A[i]/maxX)-1 for i in range(N)]) sum([math.ceil(A[i]/maxX)-1 for i in range(N)]) num X = (maxX + minX)//2 (maxX + minX)//2 X maxX = max(A) max(A) maxX K = map(int,input().rstrip().split()) map(int,input().rstrip().split()) K X = (maxX + minX)//2 (maxX + minX)//2 X minX = 0 0 minX A = list(map(int,input().rstrip().split())) list(map(int,input().rstrip().split())) A num = sum([math.ceil(A[i]/X)-1 for i in range(N)]) sum([math.ceil(A[i]/X)-1 for i in range(N)]) num maxX = X X maxX
import math
N, K = map(int,input().rstrip().split())
A = list(map(int,input().rstrip().split()))
maxX = max(A)
minX = 0
X = (maxX + minX)//2

while X!=minX:
    num = sum([math.ceil(A[i]/X)-1 for i in range(N)])
    if num<=K:
        maxX = X
    else:
        minX = X
    X = (maxX + minX)//2
num = sum([math.ceil(A[i]/maxX)-1 for i in range(N)])
if num<=K:
    print(maxX)
else:
    print(minX)