import heapq
n,k = map(int,input().split())
a = [int(i) for i in input().split()]

low = 0
high = 10**9

if k == 0:
    print(max(a))
    exit()

    
while low+1 < high:
    tmp = 0
    mid = (low + high) //2
    
    for i in range(n):
        tmp += ((a[i]+mid-1) // mid)-1
        
    if tmp <= k:
        high = mid
    else:
        low = mid
        
print(high) import heapq heapq n,k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a = [int(i) for i in input().split()] a [int(i) for i in input().split()] low = 0 low 0 high = 10**9 high 10**9 10 9 if k == 0:
    print(max(a))
    exit()

     k == 0 k 0 print(max(a)) print max(a) max a exit() exit while low+1 < high:
    tmp = 0
    mid = (low + high) //2
    
    for i in range(n):
        tmp += ((a[i]+mid-1) // mid)-1
        
    if tmp <= k:
        high = mid
    else:
        low = mid
         low+1 < high low+1 low 1 high tmp = 0 tmp 0 mid = (low + high) //2 mid (low + high) //2 low + high low high 2 for i in range(n):
        tmp += ((a[i]+mid-1) // mid)-1
        
     i range(n) range n tmp += ((a[i]+mid-1) // mid)-1 tmp ((a[i]+mid-1) // mid)-1 (a[i]+mid-1) // mid a[i]+mid-1 a[i]+mid a[i] a i mid 1 mid 1 if tmp <= k:
        high = mid
    else:
        low = mid
         tmp <= k tmp k high = mid high mid low = mid low mid print(high) print high low = 0 0 low tmp = 0 0 tmp tmp += ((a[i]+mid-1) // mid)-1 ((a[i]+mid-1) // mid)-1 tmp high = mid mid high k = map(int,input().split()) map(int,input().split()) k n,k = map(int,input().split()) map(int,input().split()) n low = mid mid low mid = (low + high) //2 (low + high) //2 mid high = 10**9 10**9 high a = [int(i) for i in input().split()] [int(i) for i in input().split()] a
import heapq
n,k = map(int,input().split())
a = [int(i) for i in input().split()]

low = 0
high = 10**9

if k == 0:
    print(max(a))
    exit()

    
while low+1 < high:
    tmp = 0
    mid = (low + high) //2
    
    for i in range(n):
        tmp += ((a[i]+mid-1) // mid)-1
        
    if tmp <= k:
        high = mid
    else:
        low = mid
        
print(high)
