peterverebics/CodeNet_Python_118 huggingface dataset:
N, K = map(int, input().split())
As = list(map(int, input().split()))

def isOK(L):
    num = 0
    for A in As:
        num += -(-A // L) - 1
    return num <= K

ng, ok = 0, 10**9
while abs(ok-ng) > 10**-6:
    mid = (ng+ok) / 2
    if isOK(mid):
        ok = mid
    else:
        ng = mid

k = int(-(-ok // 1))

for L in range(k-2, k+3):
    if isOK(L):
        print(L)
        break
N, K = map(int, input().split())
X = list(map(int, input().split()))

ub = 10 ** 9 + 7
lb = 0
while ub - lb > 1:
    mid = (ub + lb) // 2

    res = 0
    for v in X:
        res += v // mid

    if res <= K:
        ub = mid
    else:
        lb = mid

if K == 0:
    print(max(X))
else:
    print(ub)
n, k = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]
l = 0
r = max(a)

while l < r:
    m = (l + r) // 2
    cnt = 0
    for v in a:
        if m == 0:
            cnt += 2 * v
        else:
            cnt += (v + m - 1) // m - 1
    if cnt <= k:
        r = m
    else:
        l = m + 1

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

l, r = sum(A)//(N+K), A[-1]
if l == 0: l = 1

while l+1 < r:
    m = (l+r) // 2

    cuts = sum([(a-1)//m for a in A])

    if cuts <= K:
        r = m
    else:
        l = m

print(r)
import copy
import math

n, k = map(int,input().split())
a = list(map(int,input().split()))

ub = 10**9
lb = 0

while ub - lb > 0.01:
    x = (ub + lb) / 2
    cnt = 0
    for i in a:
        cnt += math.ceil(i/x)
    if cnt <= n+k:
        ub = copy.deepcopy(x)
    else:
        lb = copy.deepcopy(x)
ans = round(ub, 1)
print(math.ceil(ans))
N, K = map(int,input().split())
A = sorted(map(int,input().split()))
start = 0
end = A[-1]
while end - start >= 1:
   l = (start + end)/2
   count = 0
   for i in range(N):
      count += (A[i]-1)//l
   if count > K:
      start = l
   else:
      end = l
print(int(l))
from bisect import *
from heapq import *
import math
mod = 10**9+7
N, K = map(int, input().split())
A = list(map(int, input().split()))
ep = 0.0001
l = 0.0
r = 10**9+1
while l+ep < r:
    x = (l+r)/2
    k = 0
    for a in A:
        k += math.ceil(a/x)-1
        if k > K:
            break
    if k <= K:
        r = x
    else:
        l = x
print(math.ceil(l))
N,K = map(int, input().split())
A = [int(a) for a in input().split()]

def f(X):
    cnt = 0
    for a in A:
        cnt += int(a/X)
    return max(1, cnt)

l = 1
r = max(A)
while r-l > 0.1:
    m = (r+l)/2
    if f(m) <= K:
        r = m
    else:
        l = m

if K == 0:
    print(max(A))
elif f(int(r)+1) >= K:
    print(int(r)+1)
elif f(int(r)) >= K:
    print(int(r))
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))

def check(N, K, A, L):
    return sum(a // L for a in A) <= K

lo = 1
hi = max(A)+1
while lo < hi:
    m = (lo + hi)//2
    ok = check(N, K, A, m)
    if ok: # m 出来れるのでもっと小さく切れるか
        hi=m
    else:
        lo=m+1
print(min(max(A), lo))
n,k = map(int,input().split())
A = list(map(int,input().split()))

if sum(A)-n <= k:
    print(1)
    exit()
elif k == 0:
    print(max(A))
    exit()
top = 10**9
bottom = 1
def ok(x):
    res = 0
    for a in A:
        res += a//x
    return res <= k
while top - bottom > 1:
    mid = (top + bottom)//2
    if ok(mid):
        top = mid
    else:
        bottom = mid
print(top)
#E - Logs
import math
# 入力
N,K = map(int,input().split())
A   = list(map(int,input().split()))
Amax = int(max(A))
high = Amax
Cancut = Amax
low  = 0
while ( low < high ) :
    Cut = 0
    X = (high + low) / 2
    for i in range(N):
        Cut = Cut + math.ceil(A[i]/X) - 1
    if Cut <= K:
        high = X - 0.0001
        Cancut = X
    else:
        low  = X + 0.0001
# 出力
print(math.ceil(Cancut))
n,k,*a = map(int,open(0).read().split())
def func(b):
  c = k
  for i in a:
    if b == 0:
      c -= (i+1)
    else:
      c -= i//b
    if c < 0:
      return False
  return True
l = 0
r = max(a)
while(r>l):
  lr = (l+r)//2
  if func(lr):
    r = lr
  else:
    l = lr + 1
print(r)
# にぶたん　二分探索
n, k = map(int, input().split())
A = list(map(int, input().split()))

ok = 1
ng = max(A)

while abs(ok - ng) > 1:
  mid = (ok + ng) // 2
  cnt = 0
  for a in A:
    cnt += (a - 1) // mid
  if cnt <= k:
    ng = mid
  else:
    ok = mid

print(ng)
n,k = map(int,input().split())
log = list(map(int,input().split()))
for i in range(k):
  m = max(log)
  log.remove(m)
  log += [m/2]*2
  
print(max(log))
N,K = map(int,input().split())
arr = list(map(int,input().split()))
denominator = sum(arr)

piece = [(K+N)*arr[i]//denominator+1 for i in range(N)]
print(piece)
value = [arr[i]/piece[i] for i in range(N)]

left = K-sum(piece)
for i in range(left):
    j = value.index(max(value))
    piece[j] += 1
    value[j] = arr[j]/piece[j]

print(round(max(value)))
import heapq
from fractions import Fraction
import math

def solve():
    N, K = map(int, input().split())
    A = list(map(lambda a: Fraction(-int(a), 1), input().split()))
    heapq.heapify(A)
    for _ in range(K):
        a = heapq.heappop(A)
        heapq.heappush(A, Fraction(a.numerator, a.denominator + 1))

    ans = -heapq.heappop(A)
    print(math.ceil(ans))

solve()
from math import ceil

N, K = map(int, input().split())
A = list(map(int, input().split()))
# N, K = 2*10**5, 1
# A = [10**9]*N

def solve(x):
    m = 0
    for a in A:
        m += a//x - (a%x == 0)
    # print(x, m)
    return m <= K

ok, ng = max(A), 0
while abs(ok-ng > 0.1**5):
    mid = (ok+ng)/2
    # print(mid)
    if solve(mid):
        ok = mid
    else:
        ng = mid

print(ceil(mid))
# -*- coding: utf-8 -*-
import math
n, k = map(int, input().split())
a = list(map(int, input().split()))

a.sort()
xlist = []
wa = sum(a)
for i in a:
  xlist.append((k+n)*i/wa)

xlist_int = []
for i in xlist:
  j = int(i)
  if j == 0:
    j = 1
  xlist_int.append(j)

amari = n+k-sum(xlist_int)
xlist_hi = [xlist_int[i]/xlist[i] for i in range(n)]
xlist_hi.sort()
ans = math.ceil(wa/(k+n)/xlist_hi[amari])


print(ans)
N,K = map(int,input().split())
A = list(map(int,input().split()))
L = 0
R = max(A)
while R-L > 1:
    X = (L+R)/2
    m = 0
    for i in range(N):
        c = A[i]/X
        if c == int(c):
            m += int(c) - 1
        else:
            m += int(c)
    if m <= K:
        R = X
    else:
        L = X
print(int(R))
#二分探査かぁ…
from math import *
import fractions
import collections
import itertools
import pprint
from collections import deque
from heapq import *
N,K=map(int,input().split())
A=list(map(int,input().split()))
maxnum=10**9+20
minnum=1
while maxnum-minnum>1:
    cnt=0
    piv=(maxnum+minnum)//2
    for i in range(N):
        cnt=cnt+(ceil(A[i]/piv)-1)
    #print(cnt,piv)
    if cnt>K:
        minnum=piv
    else:
        maxnum=piv
    #print(maxnum,minnum)
    #input()
print(min(maxnum,max(A)))
N, K=map(int,input().split())
A=list(map(int,input().split()))

def judge(ans,K,A):
    cut=0
    for i in range(len(A)):
        cut+=int(A[i]/ans)
    if cut>K:
        return False
    else:
        return True

ansp=10**9
ansm=1

while ansp-ansm>0.00001:
    ans=((ansp+ansm)/2)
    if judge(ans,K,A):
        ansp=((ansp+ans)/2)
        
    else:
        ansm=((ans+ansm)/2)
        
print(int(ans)+1)
import sys
input = sys.stdin.readline
import math

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

N, K = MI()
mylist = LI()
length = len(mylist)

high = max(mylist)+1
low = 0
mid = (high + low) / 2

while high - low >= 0.001:
    temp = 0
    for i in mylist:
        if i % mid == 0:
            temp += (i // mid) - 1 
        else:
            temp += i // mid
    if temp > K:
        low = mid
    else:
        high = mid
    mid = (high + low) / 2


print(math.ceil(low))
import heapq
def main():
    N,K = map(int, input().split())
    A = list(map(int, input().split()))
    A = list(map(lambda x: x*(-1), A))
    heapq.heapify(A)
    for _ in range(K):
        r = heapq.heappop(A)
        heapq.heappush(A, r/2)
        heapq.heappush(A, r/2)
    r = -heapq.heappop(A)
    print(round(r))


if __name__ == '__main__':
    main()
from math import floor
from bisect import bisect_left
N, K = map(int,input().split())
A = list(map(int,input().split()))
def chk(L):
    cnt = 0
    for i in range(N):
        cnt += floor(A[i]/L)
    return cnt <= K
l, r = 1, max(A)
for _ in range(1000):
    m = (l+r)/2
    if chk(m):
        r = m
    else:
        l = m
print(round(m))
import math

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

m = 0
M = max(A)

while(M-m>0.0001):
    mm = 0

    mid = (M+m)/2
    for i in range(N):
        mm += math.ceil(A[i]/mid)-1

    if mm>K:
        m = mid
    else:
        M = mid

print(math.ceil(mid))
from math import ceil
n,k=map(int,input().split())
a=list(map(int,input().split()))
if k==0:
    print(max(a))
    exit()
a.sort()
left,right=0,a[n-1]
mid=right
while abs(right-left)>=1:
    mid=(left+right)/2
    temp=0
    for i in range(n-1,-1,-1):
        if a[i]<=mid: break
        temp+=a[i]//mid
    if temp>k: left=mid
    else: right=mid
print(ceil(mid))
def abc174_e():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    if k == 0: return max(A)

    lower, upper = 0, 10**9
    while upper - lower > 1:
        x = (upper + lower) // 2
        cnt = 0
        for a in A:
            cnt += a // x
            if cnt > k: break
        if cnt > k: lower = x
        else: upper = x
    return upper

if __name__ == '__main__':
    print(abc174_e())
from math import ceil

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

def C(x):
  return sum([A[i]//x for i in range(N)]) <= K
  
def binary_search2(func, n_min, n_max):
    left,right=n_min,n_max
    y_left, y_right = func(left), func(right)
    while True:
        middle = (left+right)//2
        y_middle = func(middle)
        if y_left==y_middle: left=middle
        else: right=middle
        if right-left==1:break

    return left
  
print(binary_search2(C, 1, max(A))+1)
from sys import stdin
from sys import setrecursionlimit
import numpy as np
import math

setrecursionlimit(10 ** 7)

n,k = map(int,stdin.readline().rstrip().split())
a = list(map(int,stdin.readline().rstrip().split()))

a.sort()
a = np.array(a,dtype=np.int64)

low = -1
hi = 10**9
point = 0

while hi-low > 0.001:
    ave = (hi+low)/2
    if np.sum(a//ave) <= k:
        hi = ave
    else:
        low = ave

print(math.ceil(ave))
import math
N, K = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
l = 0
r = a[-1]

while r - l > 1:
    mid = (r + l) // 2
    cnt = 0
    for i in a:
        cnt += math.ceil(i // mid)
    if cnt <= K:
        r = mid
    else:
        l = mid

print(r)
import math
N, K = map(int, input().split())
A=list(map(int,input().split()))
maxA = max(A)
right = maxA+1
left = 0
while(right-left>1):
    mid = (left+right)//2
    count = 0
    for i in A:
        count += (i-1)//mid
    if count > K:
        left = mid
    elif count <= K:
        right = mid
print(mid)
import math
n,k=map(int,input().split())
a=list(map(int,input().split()))

x0, x1 = 0, 10**9
while x0 + 1  < x1:
  x = (x0+x1)//2
  suma=0
  for i in a:
    suma += (i//x)
    
  if suma > k:
    x0 = x
  else:
    x1 = x
print(x1)
n,k = map(int, raw_input().split())
ais = map(int, raw_input().split())

def p(m,ais,k):
	t = [ m, ais, k]
	for ai in ais:
		k-= ai / m
	return k >=0

lo,hi = 1, max(ais)
print lo,hi
while(lo < hi):
	med = (lo + hi)/2
	if p(med, ais, k):
		hi = med
	else:
		lo = med + 1

print lo
n, k = map(int, input().split())
A = list(map(int, input().split()))


def check(x):
    cnt = 0
    for a in A:
        if a % x == 0:
            cnt += a//x-1
        else:
            cnt += a//x
    return k < cnt


L = 1
R = 10**10
while L != R-1:
    M = (L+R)//2
    if check(M):
        L = M
    else:
        R = M
print(R)
import math

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

min_len = 1
max_len = 1000000000


def possible_len(length: int, log: list, k: int):
    count = 0
    for i in range(N):
        count += math.ceil(log[i] / length) - 1
    if count <= k:
        return True
    else:
        return False


while max_len - min_len > 1:
    ans = (min_len + max_len) // 2
    if possible_len(ans, logs, K):
        max_len = ans
    else:
        min_len = ans

print(max_len)
n,k=map(int,input().split())
a=list(map(int,input().split()))
tmax=max(a)
tmin=0
t=(tmax+tmin)/2
import math
ans=tmax
if k==0:
  print(tmax)
else:
  while True:
    s=0
    for i in range(n):
      s=s+math.ceil(a[i]/t)-1
    if k>=s:
      ans=min(math.ceil(t),math.ceil(ans))
      tmax=t
      t=(tmin+t)/2
    else:
      tmin=t
      t=(t+tmax)/2
    if tmax-tmin<0.01:
      break
  print(ans)
import math
N, K = map(int, input().split())

a = list(map(int, input().split()))

def cal(x):
    s = 0
    for aa in a:
        s += math.ceil(aa/x) - 1
    if s <= K: return True
    else: return False

l = 1
r = max(a)
while (r - l) > 1:
    mid = (l + r) // 2
    if cal(mid):
        r = mid
    else:
        l = mid
print(r)
from bisect import *
from heapq import *
import math
mod = 10**9+7
N, K = map(int, input().split())
A = list(map(int, input().split()))
ep = 0.1
l = 0.0
r = 10**9+1
while l+ep < r:
    x = (l+r)/2
    k = 0
    for a in A:
        k += math.floor(a/x)
        if k > K:
            break
    if k <= K:
        r = x
    else:
        l = x
print(math.ceil(l))
from math import ceil
n, k = map(int, input().split())
a = list(map(int, input().split()))
mi = 0
ma = max(a)
m = ma/2
while ma-mi>0.1:
  temp = 0
  for i in range(n):
    temp += ceil(a[i]/m)-1 
    #if a[i]%m==0:
    #  temp-=1
  if temp<=k:
    ma=m
    m=(ma+mi)/2
  else:
    mi = m
    m=(ma+mi)/2
  #print("temp " + str(temp))
  #print("ma " + str(ma)+ " mi " + str(mi) + " m " + str(m))
#print(m)
print(ceil(m))
import math

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

if K == 0:
  print(int(max(A)))
  exit()

if N == 1:
  print(math.ceil(A[0]/K))
  exit()


min_A = 0
max_A = max(A) + 1

while( max_A - min_A > 1):
  now = (min_A + max_A) // 2
  temp = 0
  for i in A:
    temp += (i // now)
  if temp > K:
    min_A = now
  else:
    max_A = now
print(min_A, max_A)
print(int(min_A) + 1)
import heapq
n,k = map(int,input().split())
a = [int(i) for i in input().split()]

low = 1
high = 10**9

if k == 0:
    print(max(a))
    exit()
"""
if n == 1:
    print((a[0]+k-1)//k)
    exit()
"""
while low+1 < high:
    tmp = 0
    mid = (low + high) //2
    #print(mid)
    
    for i in range(n):
        tmp += ((a[i]+mid-1) // mid)-1
    
    if tmp <= k:
        high = mid
    else:
        low = mid
        
print(high)
N, K = map(int, input().split())
A = list(map(int, input().split()))

if K == 0:
    print(max(A))
    exit()

def f(x):
    cnt = 0
    for i in A:
        if i % x == 0:
            cnt += i//x - 1
        else:
            cnt += i//x
    
    if cnt <= K:
        return True
    else:
        return False


ok = 1
ng = 1e10
for i in range(60):
    mid = (ok + ng) // 2
    if f(mid):
        ng = mid
    else:
        ok = mid
print(ng)
from math import floor, ceil


def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    a.sort()
    lower = 1
    upper = a[-1]
    while lower + 1 < upper:
        target = (lower + upper) // 2
        now = 0
        for i in range(n):
            now += ceil(a[i] // target)
        if now > k:
            lower = target
        else:
            upper = target
    print(upper if k > 0 else a[-1])


if __name__ == '__main__':
    main()
n,k=map(int, input().split())
a = list(map(int, input().split()))
a=sorted(a)
if k==0:
    print(max(a))
    exit()

lo=0
hi=10**9
oldmid=0
while True:
    mid=(hi+lo)/2
    cnt=0
    for i in range(n):
        cnt+=round((a[i])/mid-0.5)
    if cnt>k:
        lo=mid
    elif cnt<=k:
        hi=mid
    if oldmid-0.001<=mid<=oldmid+0.001:
        #print(mid)
        print(round(mid))
        break
    oldmid=mid
N, K = map(int,input().split())
A = sorted(map(int,input().split()))
start = 0
end = A[-1]
l = (start + end)/2
while end - start >= 1:
   l = (start + end)/2
   count = 0
   for i in range(N):
      count += (A[i]-1)//l
   if count > K:
      start = l
   else:
      end = l
print(int(l)+1)
N, K = map(int, input().split())
*A, = map(int, input().split())

l, r = 10**19, 1
while abs(r-l) > 1:
    m = (l+r)//2
    k = 0
    for a in A:
        if a > m:
            k += a//m
    if k <= K:
        l = m
    else:
        r = m

print(l)
import sys

input = sys.stdin.buffer.readline
n, k = map(int, input().split())
A = list(map(int, input().split()))

# A.sort()


def hantei(x):
    cnt = 0
    for i in range(n):
        cnt += A[i] // x
    return cnt


ok = 10 ** 9
ng = 0

while ok - ng > 1:
    mid = (ok + ng) // 2
    if hantei(mid) <= k:
        ok = mid
    else:
        ng = mid
    # print(ok, ng)
print(ok)
n,k,*a = map(int,open(0).read().split())
def func(b):
  c = k
  for i in a:
    if b == 0:
      c -= i
    else:
      c -= (i-1)//b
    if c < 0:
      return False
  return True
l = 0
r = max(a)
while(r>l):
  lr = (l+r)//2
  if func(lr):
    r = lr
  else:
    l = lr + 1
print(r)
def binary_search2(func, n_min, n_max):
    left,right=n_min,n_max
    y_left, y_right = func(left), func(right)
    while True:
        middle = (left+right)//2
        y_middle = func(middle)
        if y_left==y_middle: left=middle
        else: right=middle
        if right-left==1:break

    return left
  
def f(x):
  return sum([A[i]//x for i in range(N)])<=K

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

print(binary_search2(f, 1, max(A)+5)+1)
from math import *

def trycut(val):
	ret = 0
	for i in range(n):
		ret += ceil(a[i]/val)-1
	return ret 

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

low = 0
high = 1000000000
ans  =-1

while low < high:
	mid = (low + high)/2
	cut = trycut(mid)
	# ~ print("low=",low, "high=", high,"val = ",mid,"ret = ",cut)
	if cut <= k:
		high = mid-0.01
		ans = mid
	else:
		low = mid+0.01
	# ~ if low < high: print(low, high, "je reviens")
print(round(ans))
n,k=map(int,input().split())
A=list(map(int,input().split()))

l=0
r=max(A)+1
while r-l>1:
  m=(l+r)//2
  cut=0
  for i in range(n):
    cut+=((A[i]+m-1)//m)-1
  if cut>k:
    l=m
  else:
    r=m
print(m)
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))

def check(N, K, A, L):
    return sum(a // L for a in A) <= K

answer=max(A)
lo = 1
hi = answer+1
while lo < hi:
    m = (lo + hi)//2
    ok = check(N, K, A, m)
    if ok: # 
        answer=m
        hi=m
    else:
        lo=m+1
print(min(max(A), answer))
n,k = map(int,input().split())
a = list(map(int,input().split()))

leq,high = 0,1e10
while high-leq > 1:
  l = int((leq+high)/2)
  cnt = 0
  for ai in a:
    cnt += int((ai-1)/l)
  print(l,cnt)
  if cnt>k:
    leq = l
  else:
    high = l

print(high)
n,k = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
M = max(A)
m = min(A)
def calc(r):
    return pow(2,r-1)-1
l,r = 1,M
cnt = 0
import math
while l<r:
    cnt = 0
    mid = (l+r)//2
    for a in A:
        cnt += a//mid
    if cnt <=k:
        r = mid-1
    else:
        l = mid+1
print(l)
n,k=map(int,input().split())
A=list(map(int,input().split()))
high=max(A)
low=0
while high-low>1:
    cnt=0
    now=(low+high)//2
    for a in A:
        cnt+=max((a-1)//now,0)
        if cnt>k:
            break
    if cnt>k:
        low=now
    else:
        high=now
    print(cnt,low,high)
print(high)
from math import ceil
from fractions import Fraction
from sys import exit
import heapq

n,k, *aa = map(int, open(0).read().split())

left = 1
right = sum(aa)
mid = (left + right) // 2

while right - left > 1:
    summ = sum(ceil(a/mid)-1 for a in aa)
    if summ <= k:
        right = mid
        mid = (left + right) // 2
    else:
        left = mid
        mid = (left + right) // 2

print(right)
from heapq import heappush, heappop, heapify
import math
def solve():
	n , k= map(int, input().strip().split())
	if k >= 10*7:
		return 1
	a= [(-int(x),1,int(x)) for x in input().strip().split()]
	heapify(a)
	for i in range(k):
		x,cnt,orig = heappop(a)
		x = -x
		if x <= 1:
			return 1
		heappush(a,(-((orig+cnt)//(cnt+1)),cnt+1,orig))
	return -(heappop(a)[0])
 
 
print(solve())
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

n,k=nii()
a=lnii()

ok=max(a)
ng=1

while ok-ng>1:
  m=(ok+ng)//2

  num=0
  for i in a:
    num+=i//m

  if num<=k:
    ok=m
  else:
    ng=m

print(ok)
n,k=map(int,input().split())
a=list(map(int,input().split()))
if k==0:
    print(max(a))
else:
    ans=0
    for i in a:
        d=-(-k*i//sum(a))
        if d>0:
            ans=max(ans,-(-i//(d+1)))
        else:
            ans=max(ans,i)
    print(ans)
import math

n, k = map(int, input().split())
a_list = list(map(int, input().split()))


def nibun(l, r):
  if r - l < 1:
    return l
  cnt = 0
  x = (r + l) / 2
  for i in a_list:
    cnt += math.ceil(i/x) - 1
  if cnt <= k:
    return nibun(l, x)
  else:
    return nibun(x, r)
  
if k == 0:
  print(max(a_list))
else:
  print(math.ceil(nibun(0, max(a_list))))
import copy

n, k = map( int, input().split() )
a = list( map( float, input().split() ) )

devide = [ 0 for _ in range( n ) ]
dev_len = copy.deepcopy( a )

for _ in range( k ):
    max_i = dev_len.index( max( dev_len ) )
    devide[ max_i ] += 1
    dev_len[ max_i ] = a[ max_i ] / ( devide[ max_i ] + 1 )

print( int( max( dev_len ) + 0.5 ) )
n,k=map(int,input().split())
l=list(map(int,input().split()))
#(ng,ok]type
if k==0:print(max(l));exit()
def enough(x):
    return sum((i)//x for i in l )<=k
ok,ng=10**9,0
# [ok,ng)type->eraseng,ok=ok,ng

while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if enough(mid):ok=mid
    else:ng=mid
print(ok)
n,k = map(int,input().split())
a = list(map(int,input().split()))
def check(t):
  ans = 0
  for aa in a:
    if aa > t:
      ans += aa//t
max = 10**9
min = 0
while max-min>1:
  mid = (max+min)/2
  if check(mid):
    max = mid
  else:
    min = mid
print(max)
import math

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

if K == 0:
  print(int(max(A)))
  exit()

if N == 1:
  print(math.ceil(A[0]/K))
  exit()


min_A = 0
max_A = 10**10

while( max_A - min_A > 1):
  now = (min_A + max_A) // 2
  temp = 0
  for i in A:
    if i > now:
      temp += (i // now)
  if temp > K:
    min_A = now
  else:
    max_A = now
print(int(min_A) + 1)
import math

N,K=map(int,input().split())
A=list(map(int, input().split()))
l=0
r=max(A)
while not l+1==r:
    x=math.ceil((r+l)/2)
    k=0
    for a in A:
        k+=a//x
    if k<=K:
        r=x
    else:
        l=x
print(r)
#E - Logs
import math
# 入力
N,K = map(int,input().split())
A   = list(map(int,input().split()))
Amax = int(max(A))
high = Amax
Cancut = Amax
low  = 0
while ( abs(high - low) > 0.1 ) :
    Cut = 0
    X = (high + low) / 2.0
    for i in range(N):
        Cut = Cut + math.ceil(A[i]/X) - 1
    if Cut <= K:
        high = X
        Cancut = X
    else:
        low  = X
# 出力
print(math.ceil(Cancut))
import math
n, k = map(int, input().split())
aas = list(map(int, input().split()))
diff = pow(10,-6)
left = 1
right = 10**9
def judge(mid):
    cut = 0
    for i in aas:
        cut += math.ceil(i / mid) - 1
    if cut <= k:
        return True
    else:
        return False
while left < right:
    mid = (left + right) / 2
    if (left <= right <= left + diff) or (right <= left <= right + diff):
        break
    elif judge(mid):
        right = mid
    else:
        left = mid
print(int(right))
#二分探査かぁ…
from math import *
import fractions
import collections
import itertools
import pprint
from collections import deque
from heapq import *
N,K=map(int,input().split())
A=list(map(int,input().split()))
maxnum=10**9+20
minnum=1
while maxnum-minnum>1:
    cnt=0
    piv=(maxnum+minnum)//2
    for i in range(N):
        cnt=cnt+ceil(A[i]/piv)-1
    #print(cnt,piv)
    if cnt>K:
        minnum=piv
    else:
        maxnum=piv
    #print(maxnum,minnum)
    #input()
print(maxnum)