# -*- coding: utf-8 -*-
import sys
N,K=map(int, sys.stdin.readline().split())
A=map(int, sys.stdin.readline().split())

#最大の長さがnの丸太にK回切ってすることができるか？
def func(n):
    cnt=0
    for a in A:
        #print "a :: ",a
        if a%n==0:
            cnt+=a/n-1
        else:
            cnt+=a/n
    if cnt<=K:
        return True
    else:
        return False

l=0
r=10**9
while 1<r-l:
    m=(l+r)/2
    if func(m):
        r=m
    else:
        l=m
print r import sys sys N,K=map(int, sys.stdin.readline().split()) N map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split K A=map(int, sys.stdin.readline().split()) A map(int, sys.stdin.readline().split()) map int sys.stdin.readline().split() sys.stdin.readline().split sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline split def func(n):
    cnt=0
    for a in A:
        #print "a :: ",a
        if a%n==0:
            cnt+=a/n-1
        else:
            cnt+=a/n
    if cnt<=K:
        return True
    else:
        return False func cnt=0 cnt 0 for a in A:
        #print "a :: ",a
        if a%n==0:
            cnt+=a/n-1
        else:
            cnt+=a/n
     a A if a%n==0:
            cnt+=a/n-1
        else:
            cnt+=a/n
     a%n==0 a%n a n 0 cnt+=a/n-1 cnt a/n-1 a/n a n 1 cnt+=a/n cnt a/n a n if cnt<=K:
        return True
    else:
        return False cnt<=K cnt K return True True return False False n n l=0 l 0 r=10**9 r 10**9 10 9 while 1<r-l:
    m=(l+r)/2
    if func(m):
        r=m
    else:
        l=m 1<r-l 1 r-l r l m=(l+r)/2 m (l+r)/2 l+r l r 2 if func(m):
        r=m
    else:
        l=m func(m) func m r=m r m l=m l m print N,K=map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) N A=map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) A K=map(int, sys.stdin.readline().split()) map(int, sys.stdin.readline().split()) K def func(n):
    cnt=0
    for a in A:
        #print "a :: ",a
        if a%n==0:
            cnt+=a/n-1
        else:
            cnt+=a/n
    if cnt<=K:
        return True
    else:
        return False def func(n):
    cnt=0
    for a in A:
        #print "a :: ",a
        if a%n==0:
            cnt+=a/n-1
        else:
            cnt+=a/n
    if cnt<=K:
        return True
    else:
        return False func l=0 0 l l=m m l r=m m r m=(l+r)/2 (l+r)/2 m r=10**9 10**9 r
# -*- coding: utf-8 -*-
import sys
N,K=map(int, sys.stdin.readline().split())
A=map(int, sys.stdin.readline().split())

#最大の長さがnの丸太にK回切ってすることができるか？
def func(n):
    cnt=0
    for a in A:
        #print "a :: ",a
        if a%n==0:
            cnt+=a/n-1
        else:
            cnt+=a/n
    if cnt<=K:
        return True
    else:
        return False

l=0
r=10**9
while 1<r-l:
    m=(l+r)/2
    if func(m):
        r=m
    else:
        l=m
print r