N, K = map(int, input().split())
logs = list(map(int, input().split()))
maxL = max(logs)

def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid+1, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx

if K > 0:
    ans = binsearch(1, maxL+1)
else:
    ans = maxL
print(ans) N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K logs = list(map(int, input().split())) logs list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split maxL = max(logs) maxL max(logs) max logs def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid+1, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx binsearch if minz >= maxz:
        return minz

     minz >= maxz minz maxz return minz minz mid = (maxz + minz)//2 mid (maxz + minz)//2 maxz + minz maxz minz 2 ncut = 0 ncut 0 for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid+1, maxz)

     i range(N) range N thiscut = int((logs[i] + mid - 1)/mid) - 1 thiscut int((logs[i] + mid - 1)/mid) - 1 int((logs[i] + mid - 1)/mid) int (logs[i] + mid - 1)/mid logs[i] + mid - 1 logs[i] + mid logs[i] logs i mid 1 mid 1 ncut += thiscut ncut thiscut if ncut > K:
            return binsearch(mid+1, maxz)

     ncut > K ncut K return binsearch(mid+1, maxz) binsearch(mid+1, maxz) binsearch mid+1 mid 1 maxz if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
     ncut < K ncut K return binsearch(minz, mid) binsearch(minz, mid) binsearch minz mid maxx = 0 maxx 0 for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
     i range(N) range N thiscut = int((logs[i] + mid - 1)/mid) - 1 thiscut int((logs[i] + mid - 1)/mid) - 1 int((logs[i] + mid - 1)/mid) int (logs[i] + mid - 1)/mid logs[i] + mid - 1 logs[i] + mid logs[i] logs i mid 1 mid 1 thislen = int((logs[i] + thiscut)/(thiscut+1)) thislen int((logs[i] + thiscut)/(thiscut+1)) int (logs[i] + thiscut)/(thiscut+1) logs[i] + thiscut logs[i] logs i thiscut thiscut+1 thiscut 1 if maxx < thislen: maxx = thislen
     maxx < thislen maxx thislen return maxx maxx minz minz maxz maxz if K > 0:
    ans = binsearch(1, maxL+1)
else:
    ans = maxL K > 0 K 0 ans = binsearch(1, maxL+1) ans binsearch(1, maxL+1) binsearch 1 maxL+1 maxL 1 ans = maxL ans maxL print(ans) print ans ans = binsearch(1, maxL+1) binsearch(1, maxL+1) ans ans = maxL maxL ans maxL = max(logs) max(logs) maxL def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid+1, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid+1, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx binsearch N, K = map(int, input().split()) map(int, input().split()) N K = map(int, input().split()) map(int, input().split()) K logs = list(map(int, input().split())) list(map(int, input().split())) logs
N, K = map(int, input().split())
logs = list(map(int, input().split()))
maxL = max(logs)

def binsearch(minz, maxz):
    if minz >= maxz:
        return minz

    mid = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        ncut += thiscut
        if ncut > K:
            return binsearch(mid+1, maxz)

    if ncut < K:
        return binsearch(minz, mid)
    #else ncut == K
    maxx = 0
    for i in range(N):
        thiscut = int((logs[i] + mid - 1)/mid) - 1
        thislen = int((logs[i] + thiscut)/(thiscut+1))
        if maxx < thislen: maxx = thislen
    return maxx

if K > 0:
    ans = binsearch(1, maxL+1)
else:
    ans = maxL
print(ans)
