from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()



N,K=map(int,input().split())
A=list(map(int,input().split()))


def main(n):
    return(sum([max(i//n-(i%n==0)*1,0) for i in A])<=K)
#print(main(5))
ng=0
ok=10**18
while ok-ng>1:
    mid=(ok+ng)//2
    if main(mid):
        ok=mid
    else:
        ng=mid

print(ok) from heapq import * import sys sys from collections import * from itertools import * from decimal import * import copy copy from bisect import * import math math sys.setrecursionlimit(4100000) sys.setrecursionlimit sys setrecursionlimit 4100000 def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b)) gcd if(a%b==0):return(b)
     a%b==0 a%b a b 0 return (gcd(b,a%b)) gcd(b,a%b) gcd b a%b a b a a b b input=lambda :sys.stdin.readline().rstrip() input lambda :sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip N,K=map(int,input().split()) N map(int,input().split()) map int input().split() ().split () input split K A=list(map(int,input().split())) A list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split def main(n):
    return(sum([max(i//n-(i%n==0)*1,0) for i in A])<=K)
#print(main(5)) main max(i//n-(i%n==0)*1,0) for i in A for i in A i A for i in A max(i//n-(i%n==0)*1,0) max i//n-(i%n==0)*1 i//n i n (i%n==0)*1 i%n==0 i%n i n 0 1 0 return(sum([max(i//n-(i%n==0)*1,0) for i in A])<=K) sum([max(i//n-(i%n==0)*1,0) for i in A])<=K sum([max(i//n-(i%n==0)*1,0) for i in A]) sum [max(i//n-(i%n==0)*1,0) for i in A] K n n ng=0 ng 0 ok=10**18 ok 10**18 10 18 while ok-ng>1:
    mid=(ok+ng)//2
    if main(mid):
        ok=mid
    else:
        ng=mid ok-ng>1 ok-ng ok ng 1 mid=(ok+ng)//2 mid (ok+ng)//2 ok+ng ok ng 2 if main(mid):
        ok=mid
    else:
        ng=mid main(mid) main mid ok=mid ok mid ng=mid ng mid print(ok) print ok N,K=map(int,input().split()) map(int,input().split()) N input=lambda :sys.stdin.readline().rstrip() lambda :sys.stdin.readline().rstrip() input A=list(map(int,input().split())) list(map(int,input().split())) A ng=0 0 ng ok=10**18 10**18 ok mid=(ok+ng)//2 (ok+ng)//2 mid ok=mid mid ok K=map(int,input().split()) map(int,input().split()) K ng=mid mid ng def main(n):
    return(sum([max(i//n-(i%n==0)*1,0) for i in A])<=K)
#print(main(5)) def main(n):
    return(sum([max(i//n-(i%n==0)*1,0) for i in A])<=K)
#print(main(5)) main def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b)) def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b)) gcd
from heapq import *
import sys
from collections import *
from itertools import *
from decimal import *
import copy
from bisect import *
import math
sys.setrecursionlimit(4100000)
def gcd(a,b):
    if(a%b==0):return(b)
    return (gcd(b,a%b))
input=lambda :sys.stdin.readline().rstrip()



N,K=map(int,input().split())
A=list(map(int,input().split()))


def main(n):
    return(sum([max(i//n-(i%n==0)*1,0) for i in A])<=K)
#print(main(5))
ng=0
ok=10**18
while ok-ng>1:
    mid=(ok+ng)//2
    if main(mid):
        ok=mid
    else:
        ng=mid

print(ok)
