def waru(a,b):
  if a%b==0:
    return a//b
  else:
    return (a//b)+1
N,K=map(int,input().split())
A=list(map(int,input().split()))
ue=sum(A)
sita=1
for i in range(50):
  n=(ue+sita)//2
  L=[waru(i,n)-1 for i in A]
  if sum(L)>K:
    sita=n
  else:
    ue=n
  if ue==sita:
    print(ue)
    exit()
  elif ue-sita==1:
    n=sita
    L=[waru(i,n)-1 for i in A]
    if sum(L)>K:
      print(n+1)
      exit()
    else:
      print(n)
      exit() def waru(a,b):
  if a%b==0:
    return a//b
  else:
    return (a//b)+1 waru if a%b==0:
    return a//b
  else:
    return (a//b)+1 a%b==0 a%b a b 0 return a//b a//b a b return (a//b)+1 (a//b)+1 a//b a b 1 a a b b 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 ue=sum(A) ue sum(A) sum A sita=1 sita 1 for i in range(50):
  n=(ue+sita)//2
  L=[waru(i,n)-1 for i in A]
  if sum(L)>K:
    sita=n
  else:
    ue=n
  if ue==sita:
    print(ue)
    exit()
  elif ue-sita==1:
    n=sita
    L=[waru(i,n)-1 for i in A]
    if sum(L)>K:
      print(n+1)
      exit()
    else:
      print(n)
      exit() i range(50) range 50 n=(ue+sita)//2 n (ue+sita)//2 ue+sita ue sita 2 waru(i,n)-1 for i in A for i in A i A for i in A waru(i,n)-1 waru(i,n) waru i n 1 L=[waru(i,n)-1 for i in A] L [waru(i,n)-1 for i in A] if sum(L)>K:
    sita=n
  else:
    ue=n
   sum(L)>K sum(L) sum L K sita=n sita n ue=n ue n if ue==sita:
    print(ue)
    exit()
  elif ue-sita==1:
    n=sita
    L=[waru(i,n)-1 for i in A]
    if sum(L)>K:
      print(n+1)
      exit()
    else:
      print(n)
      exit() ue==sita ue sita print(ue) print ue exit() exit elif ue-sita==1:
    n=sita
    L=[waru(i,n)-1 for i in A]
    if sum(L)>K:
      print(n+1)
      exit()
    else:
      print(n)
      exit() ue-sita==1 ue-sita ue sita 1 n=sita n sita waru(i,n)-1 for i in A for i in A i A for i in A waru(i,n)-1 waru(i,n) waru i n 1 L=[waru(i,n)-1 for i in A] L [waru(i,n)-1 for i in A] if sum(L)>K:
      print(n+1)
      exit()
    else:
      print(n)
      exit() sum(L)>K sum(L) sum L K print(n+1) print n+1 n 1 exit() exit print(n) print n exit() exit K=map(int,input().split()) map(int,input().split()) K sita=n n sita n=sita sita n L=[waru(i,n)-1 for i in A] [waru(i,n)-1 for i in A] L N,K=map(int,input().split()) map(int,input().split()) N ue=sum(A) sum(A) ue n=(ue+sita)//2 (ue+sita)//2 n def waru(a,b):
  if a%b==0:
    return a//b
  else:
    return (a//b)+1 def waru(a,b):
  if a%b==0:
    return a//b
  else:
    return (a//b)+1 waru A=list(map(int,input().split())) list(map(int,input().split())) A L=[waru(i,n)-1 for i in A] [waru(i,n)-1 for i in A] L ue=n n ue sita=1 1 sita
def waru(a,b):
  if a%b==0:
    return a//b
  else:
    return (a//b)+1
N,K=map(int,input().split())
A=list(map(int,input().split()))
ue=sum(A)
sita=1
for i in range(50):
  n=(ue+sita)//2
  L=[waru(i,n)-1 for i in A]
  if sum(L)>K:
    sita=n
  else:
    ue=n
  if ue==sita:
    print(ue)
    exit()
  elif ue-sita==1:
    n=sita
    L=[waru(i,n)-1 for i in A]
    if sum(L)>K:
      print(n+1)
      exit()
    else:
      print(n)
      exit()