peterverebics/CodeNet_Python_118 huggingface dataset:
import math

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

l = 1
r = 10**9
while(r-l > 1):
  mid = (r+l)//2
  cut = 0
  for num in nums:
    cut += math.ceil(num/mid)-1
  if cut <= K:
    r = mid
  else:
    l = mid
print(math.ceil(r))
n,k=map(int,input().split())
from collections import deque
A=deque(map(int,input().split()))
A=sorted(A)
if 90*n<k:
    print(1)
else:
    i=0
    while i!=k:
        a=A.pop()/2
        A+=[a]*2
        A=sorted(A)
        i+=1
    print(int(A.pop()))
n, k = map(int, input().split())
a = list(map(int, input().split()))

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

l = 1
u = max(a)

while u > l+1:
#    print(l,u)
    c = (l + u) // 2
    cnt = 0
    for i in a:
        cnt = cnt + ((i-1)//c)
    if cnt <= k:
        u = c
    else:
        l = c

print(u)
from sys import stdin
input = stdin.buffer.readline
n, k = map(int, input().split())
*a, = map(int, input().split())
def f(mx):
    cnt = 0
    for i in a:
        cnt += (i + mx - 1) // mx - 1
    return cnt
l, r = 1, int(1e9 + 1)
while r - l > 1:
    m = (l + r) >> 1
    if f(m) > k:
        l = m
    else:
        r = m
print(r)
import math
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))

def lte_k(x, len_list):
    counter = 0
    for item in len_list:
        counter += math.ceil(item / x) - 1
    return counter <= k

def binary_search():
    low = 1
    high = max(a)

    while low < high:
        mid = math.ceil((low + high) / 2)
        guess = lte_k(mid, a)
        if guess:
            high = mid-1
        else:           
            low = mid

    return high+1

print(binary_search())
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
if int(R) - int(L) == 0:
    print(int(R)+1)
else:
    print(int(R))
from math import ceil 
n,k=map(int,input().split())
a=sorted(list(map(int,input().split())))

L=a[-1]
if k==0:
    print(L)
    exit()

M=L
m=0
while M-m>=0.01:
    x=(M+m)/2
    c=0
    for p in a:
        c+=ceil(p/x)-1
        if c>k:
            break
    if c<=k:
        M=x
    else:
        m=x
    x=(M+m)/2
print(ceil((M+m)/2))
N, K = map(int, input().split())
A = list(map(int, input().split()))

mi = 1
ma = 10**9
while(ma - mi != 1):
    c = 0
    mid = (ma + mi) // 2
    for i in range(N):
        c += A[i] // mid - (A[i] % mid == 0)
    if c > K:
        mi = mid
    else:
        ma = mid
print(ma)
import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
a.sort()
xma=a[-1]
x=a[-1]/2
xmi=0
xo=-1
while abs(x-xo)>0.0001:
  k2=k
  for i in range(n):
      k2-=(a[i]//x)
  if k2<0:
      xo=x
      xmi=x
      x=(xma+x)/2
  else:
    xo=x
    xma=x
    x=x/2

print(math.ceil(x))
import math
n, k = list(map(int,input().split()))
a = list(map(int,input().split()))

def lte_k(x, len_list):
    counter = 0
    for item in len_list:
        counter += math.ceil(item / x) - 1
    return counter <= k

def binary_search():
    low = 1
    high = max(a)

    while low < high-1:
        mid = (low + high) // 2
        guess = lte_k(mid, a)
        if guess:
            high = mid
        else:
            low = mid
    return high

print(binary_search())
#!/usr/bin/env python3
n, k = map(int, input().split())
a = list(map(int, input().split()))

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


def f(p):
    c = 0
    for x in a:
        c += x // p
    return c


ok, ng = 0, max(a)
while abs(ok - ng) > 1:
    m = (ok + ng) // 2
    if f(m) > k:
        ok = m
    else:
        ng = m
print(ok + 1)
rule=input().split()
N=int(rule[0])
K=int(rule[1])
data=input().split()
ans=0
for i in range(len(data)):
    ans+=int(data[i])
import math
print(math.floor(ans/(K+1))+1)
from math import floor, ceil

n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
l = 1
r = max(a)
while r - l > 1:
    c = (l+r)//2
    cnt = 0
    for i in a:
        cnt += max(ceil(i/c) - 1, 0)
    if cnt <= k:
        r = c
    else:
        l = c
print(r)
import numpy as np

N, K = [int(x) for x in input().split()]
A = np.array([int(x) for x in input().split()])

L = np.max(A)

ans = L
low = 1
high = L
while 1:
    if low == high:
        ans = low
        break
    mid = (low + high) // 2
    if np.sum(A // mid) <= K:
        high = mid
    else:
        low = mid + 1

print(ans)
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(mid))
import math
n,k=map(int, input().split())
a=list(map(int, input().split()))
right=10**9
left=0
def cutable(a,x):
    count=0
    for i in a:
        count+=math.ceil(i/x)-1
    return count<=k    
while right>left+1:
    mid=(right+left)//2
    if cutable(a,mid):
        left=mid
    else:
        right=mid+1
print(math.ceil(max(a)/left))
import math

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

def seikai(x):
    count = 0
    for i in range(n):
        count += math.ceil(a[i] / x) - 1

    if(count <= k):
        return 1
    else:
        return 0

l = 1
r = 10 ** 9
while(r - l > 1):
    temp = (r + l) // 2
    if(seikai(temp) == 1):
        r = temp
    else:
        l = temp

print(r)
import math
def is_ok(K, N, A, length):
    s = 0
    for i in range(N):
        if A[i] > length:
            s += math.ceil(A[i] / length)-1
    return K >= s


N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
A.sort()
if K == 0:
    print(A[-1])
    exit()
ok = A[-1]
ng = 1
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if is_ok(K, N, A, mid):
        ok = mid
    else:
        ng = mid

print(math.ceil(ok))
n, k = map(int, input().split())
a = list(map(int, input().split()))
low = 0
top = max(a) + 1

while top - low > 1:
  mid = (top + low) // 2
  cnt = 0
  for i in range(n):
    if a[i] % mid == 0:
      cnt += (a[i] // mid) - 1
    else:
      cnt += a[i] // mid
  if cnt <= k:
    top = mid
  else:
    low = mid
print(low)
n, k = map(int, input().split())
a = list(map(int, input().split()))
 
floor = 1
ceil = max(a)
L = (ceil + floor)//2
 
 
def cut(long, logs):
    cnt = 0
    for i in logs:
        cnt += (i / long) - 1
        if i % long != 0:
            cnt += 1
    return cnt
 
 
while ceil - floor > 1:
    L = (ceil + floor)//2
    num = cut(L, a)
    if num > k:
        floor = L
    else:
        ceil = L
 
print(ceil)
def isok(arg):
    count = 0
    for i in range(N):
        count += -(-A[i]//arg)-1
    if count <= K:
        return True
    else:
        return False

def bisect(ng, ok):
    while (abs(ok - ng) > 1):
        mid = (ok + ng) // 2
        if isok(mid):
            ok = mid
        else:
            ng = mid
    return ok

N,K = map(int,input().split())
A = list(map(int,input().split()))
print(bisect(1,10**9))
from collections import Counter
import heapq
from math import ceil

N,K = list(map(int,input().split()))
A = list(map(lambda x: -int(x),input().split()))
counter = Counter(A)
A = []
for key in counter.keys():
    heapq.heappush(A,(key,counter[key]))

if 10**6 < K:
    print(1)
else:
    while 0 < K:
        m = heapq.heappop(A)
        heapq.heappush(A,(m[0]*m[1]/(m[1]+1),m[1]+1))
        K -= 1

# print(A)
print(ceil(-heapq.heappop(A)[0]))
f=lambda:[*map(int,input().split())]
n,k=f()
a=f()
a=[i*100 for i in a]
# Binary Search
def ok(x):
    c=0
    for i in a:
      c+=0--i//x
    return c<=n+k
l,r=0,10**11+1
while r-l>1:
  m=l+r>>1
  if ok(m): r=m
  else: l=m
print(l,r)
t=0--r//100
print(t-ok(t-1) if t>1 else t)
from bisect import bisect_left
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)
ok = 0
ng = 10**10


def judge(l):
    cnt = 0
    for aa in a:
        if aa <= l:
            break
        while aa > l:
            aa /= 2
            cnt += 1
    return cnt <= k


while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if judge(mid):
        ok = mid
    else:
        ng = mid
print(ok)
import sys
import math
def Ii():return int(sys.stdin.readline())
def Mi():return map(int,sys.stdin.readline().split())
def Li():return list(map(int,sys.stdin.readline().split()))
n,k = Mi()
a = Li()
sa = sum(a)
list.sort(a, reverse=True)
ma = sa//(n+k)+1
div = [0]*n
for i in range(n):
  div[i] = math.ceil(a[i]/ma)-1
  
sd = sum(div)
if sd > k:
  j = 0
  
      
list.sort(div, reverse=True)
print(div)
for i in range(n):
  a[i] = math.ceil(a[i]/(div[i]+1))
  
print(max(a))
import heapq
from math import ceil

N,K = list(map(int,input().split()))
A = list(map(lambda x: -int(x),input().split()))

heaplist = []
for Ai in A:
    heapq.heappush(heaplist,(Ai,1,Ai))

if 10**7 < K:
    print(1)
else:
    while 0 < K:
        m = heapq.heappop(heaplist)
        heapq.heappush(heaplist,(m[2]/(m[1]+1),m[1]+1,m[2]))
        K -= 1

# print(A)
print(ceil(-heapq.heappop(heaplist)[0]))
N, K = map(int,input().split())
A = sorted(list(map(float,input().split())))
import math

def cut(x): #xの丸太を半分に
    global A
    A[x] = A[x]/2
    A = sorted(A)

for p in range(K):
    cut(N-1)

print(math.ceil(A[N-1]))
import math
def is_ok(K, N, A, length):
    s = 0
    for i in range(N):
        if A[i] > length:
            s += math.ceil(A[i] / length)-1
    return K >= s


N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
A.sort()
if K == 0:
    print(A[-1])
    exit()
ok = 10**9
ng = 1
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if is_ok(K, N, A, mid):
        ok = mid
    else:
        ng = mid

print(math.ceil(ok))
N,K = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
def f(A,N):
    ans = 0
    for i in range(len(A)):
        ans += -(-A[i]//N) - 1
    return ans
ok = 1000000000
ng = 1
while abs(ok-ng) > 1:
    mid = (ok+ng) // 2
    if f(A,mid) <= K:
        ok = mid
    else:
        ng = mid
print(ok)
n,k =  map(int,input().split())
A = list(map(int,input().split()))
A.sort(reverse=True)
#print(A)

for i in range(k):
    
    
    A[0] /= 2
    A.sort(reverse=True)

print(int(A[0]))
N, K = map(int,input().split())
A = sorted(map(int,input().split()))
start = 0
end = A[-1]
l = (start + end)/2
while end - start >= 0.5:
   l = (start + end)/2
   count = 0
   for i in range(N):
      count += (A[i]-1)//l
   if count > K:
      start = l
   else:
      end = l
ans = (start + end)/2
print(int(ans)+1)
n, k = map(int, input().split())
A = [*map(int, input().split())]
l, r = 1, 10**9 + 1 # [l,r)
ans = r
while r - l > 1:
    m = (l + r) // 2
    c = 0
    for a in A: c += (a+m-1) // m - 1
    if c <= k:
        r = m
        ans = min(ans, m)
    else: l = m
print(ans)
n,k=map(int,input().split())
a=list(map(int,input().split()))
s=sum(a)
f=len(a)
d=s/(k+f)
p=0
g=max(a)
while k>0:
  g=max(a)
  p=g//d
  k-=p
  a.remove(g)
k+=p
if k==0:
  print(g)
else:
  print(int(g//(k+1)+1))
import sys
readline = sys.stdin.readline
 
N, K = map(int, readline().split())
A = list(map(int, readline().split()))
 
l = 0
r = 10**10
 
def test(m):
  return sum((a + m - 1) // m for a in A) <= K

while l + 1 < r:
  m = (l + r) // 2
  if test(m):
  	r = m
  else:
    l = m
print(r)
import numpy as np
import math as mt
n, k = map(int, input().split())
A = list(map(float, input().split()))
arrayA = np.array(A)

for i in range(k):
  j = np.argmax(arrayA)
  arrayA[j] = arrayA[j]/2
  
print(mt.ceil(arrayA[np.argmax(arrayA)]))
import sys
import math
n,k = map(int,input().split())
a = list(map(int,input().split()))
if k ==0:
  print(max(a))
  sys.exit()
def check(t):
  ans = 0
  if t==0:
    return False
  for aa in a:
    if aa > t:
      ans += aa//t
  return ans <= k
max = 10**9+1
min = 0
while max-min>1:
  mid = (max+min)/2
  if check(mid):
    max = mid
  else:
    min = mid
print(math.ceil(max))
import heapq

length_heap = []

N, total_cut = map(int, input().split())

length_list = list(map(int, input().split()))
for index, l in enumerate(length_list):
    heapq.heappush(length_heap, (-l, 1, index))

for i in range(total_cut):
    longest, cut_n, idx = heapq.heappop(length_heap)
    heapq.heappush(length_heap, (-length_list[idx]/(cut_n+1), (cut_n + 1), idx))

result = -heapq.heappop(length_heap)[0]

print(int(result+0.5))
#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.0
    for i in range(N):
        Cut = Cut + math.ceil(A[i]/X) - 1
    if Cut <= K:
        high = X - 0.01
        Cancut = X
    else:
        low  = X + 0.01
# 出力
Cancut = math.floor( 100 * Cancut) / 100.0
print(math.ceil(Cancut))
import math

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

    def _f(length: int) -> bool:
        count = 0
        for a in A:
            count += int((a-1) / length)
        return count <= K

    l = 0
    r = 1e9
    while (r-l) > 1:
        center = int((l+r) / 2)
        if _f(center):
            r = center
        else:
            l = center
    print(r)

if __name__ == "__main__":
    resolve()
n,k=map(int,input().split())
a=list(map(int,input().split()))
ok=max(a)
ng=0
while ok-ng>1:
    mid=(ok+ng)//2
    cnt=0
    for i in range(n):
        num=a[i]
        cnt+=num//mid
    if cnt<=k:
        ok=mid
    else:
        ng=mid
print(ok)
(N,K) = map(int,input().split())
l = input().split()
max = 0
for i in range(N):
    l[i]= int(l[i])
    if max <= l[i]:
        max = l[i]

lb = 1
ub = max

def cut(m):
    k = 0
    for i in range(N):
        k += -((-1*l[i])//m)-1
    return k

while ub - lb > 1:
    if K == 0:
        break
    if cut((ub+lb)//2)>K:
        lb = (ub+lb)//2
    else:
        ub = (ub+lb)//2

print(ub)
n,k=map(int,input().split())
a=list(map(int,input().split()))
import math
x=0
y=10**9
z=5*(10**8)
s=0
for i in range(100):
    t=0
    for j in range(n):
        t+=a[j]//z
    if t<=k:
        s=t
        y=z
        z=(x+y)/2
    else:
        x=z
        z=(x+y)/2
    print(x,y,z)
print(math.ceil(z))
n, k = map(int, input().split())
A = [*map(int, input().split())]
l, r = 1, max(A) # [l,r]
while r - l > 1:
    m = (l + r) // 2
    c = 0
    for a in A: c += a // m 
    if c <= k: r = m
    else: l = m
print(r)
import sys
input = sys.stdin.readline

def main():
    N,K = map(int, input().split())
    A = list(map(int, input().split()))
    
    l,r = 0, max(A)
    while l < r-1:
        mid = l + (r-l)//2
        cnt = 0
        for a in A:
            cnt+= a//mid
            
        if cnt <= K:
            r = mid
        else:
            l = mid
    print(r)
    
main()
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
    else:
        right = mid
print(mid)
import math

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

ans = max(a_list) / 2

def nibun(x, rep, _max):
  cnt = 0
  rep += 1
  for i in a_list:
    cnt += math.ceil(i/x) - 1
  if cnt <= k and rep < 1000:
    return nibun(x / 2, rep, x)
  elif rep < 1000:
    return nibun((x+_max)/ 2, rep, _max)
  else:
    return x
  
print(math.ceil(nibun(ans, 0, ans*2)))
import math
N, K = map(int, input().split())
A=list(map(int,input().split()))
maxA = max(A)
num = 0
right = maxA
left = 0
while(right-left>1):
    num = left+math.floor((right-left)*0.5)
    count = 0
    for i in range(len(A)):
        count += math.ceil(A[i]/num)-1
    if count > K:
        left = num
    elif count <= K:
        right = num

print(num+1)
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)]
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]

import math
print(round(max(value)))
import sys
import math
input = sys.stdin.readline

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

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

def check(x):
    res = 0
    for i in a:
        res += i // x
    return res

l = 0
r = 10 ** 9 + 1
for _ in range(40):
    x = (l + r) / 2
    if check(x) >= k:
        l = x
    else:
        r = x
print(math.ceil(l))
n,k = map(int, raw_input().split())
ais = map(int, raw_input().split())

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

lo,hi = 1, max(ais)

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()))


a.sort()

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

def solve(num):
    ret=0
    for tmp in a:
        ret+= tmp//num
    return k>=ret

l=0
r=10**18
while r-l>1:
    mid=(l+r)//2

    if solve(mid):
        r=mid
    else:
        l=mid

for i in range(max(mid-10,1),mid+10):
    if solve(i):
        print(i)
        exit()
N,K=[int(s) for s in input().split()]
maruta=[int(s) for s in input().split()]

def possible(x):
  cut=0
  for e in maruta:
    cut+=e//x
  if cut<=K:
    return True
  else:
    return False

a=1
b=10**9
while b-a>1:
  c=(a+b)//2
  if possible(c):
    b=c
  else:
    a=c

if a==1 and possible(1):
  print(1)
else:
  print(b)
n, k = map(int, input().split())
a = list(map(int, input().split()))

l, r = 1, 10 ** 9
while l < r:
    m = (l + r) // 2
    if sum(map(lambda v: (v - 1) // m, a)) > k:
        l = m + 1
    else:
        r = m
print(l, r)
import math
N, K = map(int,input().split())
logs = list(map(int,input().split()))
a = 0
b = max(logs)
b_memo = set()
count=0
flg =0
while b-a < 1:
    c = (a+b)//2
    times = []
    for i in logs:
        times.append(math.floor(i/c))
    if sum(times) > K:
        a = c
    else:
        b = c

print(math.ceil(b))
N, M = input().strip().split()
n, k = [int(N), int(M)]
a = list(map(int, input().strip().split()))
le = 0
ri = 10000000000
while ri - le > 1:
    mid = (le + ri) 
    num = 0
    for i in a:
        num += (i-1) 
    if num <= k:
        ri = mid
    else:
        le = mid
print(ri)
def judge(A, x, k):
    ans = 0
    for a in A:
        ans += a // x
        if ans > k:
            return False
    return True


n, k = map(int, input().split())
A = list(map(int, input().split()))
l = 0
r = max(A)
while r - l != 1:
    x = (r + l) // 2
    if judge(A, x, k):
        r = x
    else:
        l = x
print(r)
import math

N,K = map(int, input().split())
A = list(map(int, input().split()))
epsilon = 10**(-9)
A = [a-epsilon for a in A]

_min = 0
_max = max(A)

while int(_min)<int(_max):
  new = (_min+_max)/2
  times = sum([math.floor(a/new) for a in A])
  #print(new, times)
  if times <= K:
    _max = new
  else:
    _min = new
    
print(math.ceil(_max))
from math import ceil
N, K = map(int,input().split())
A = list(map(int,input().split()))
def chk(L):
    cnt = 0
    for i in range(N):
        cnt += ceil(A[i]/L)-1
    return cnt <= K
l, r = 1, max(A)
while l <= r:
    m = (l+r)//2
    if chk(m):
        r = m-1
    else:
        l = m+1
print(max([x for x in [m-1,m,m+1] if x > 0 and chk(x)]))
import math
import sys
sys.setrecursionlimit(10**7)
n, k = map(int, input().split())
a = list(map(int, input().split()))
def binary_search(left, right):
    if right - left <= 0.1:
        return right
    middle = round((right + left) / 2, 2)
    if is_can(middle):
        return binary_search(middle, right)
    else:
        return binary_search(left, middle)
def is_can(target):
    count = 0
    for i in range(n):
        count += a[i] //target
    return count > k
print(math.ceil(round(binary_search(0,10**10),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(high))
N, K = map(int, input().split())
A = [int(i) for i in input().split()]

def f(length, ls):
    cur = 0
    for a in ls:
        cur += a//length
    if cur <= K:
        return True
    else:
        return False

ok, ng = max(A), 0
while abs(ok - ng) > 1:
    z = (ok+ng)//2
    if f(z, A) == True:
        ok = z
    else:
        ng = z
print(ok)
N, K = map(int, input().split())
A = list(map(int, input().split()))

def isOk(x):
    cnt = 0
    for a in A:
        cnt += a // x
    return cnt <= K

ok = max(A)
ng = 0
while ok - ng > 1:
    mid = (ok + ng) // 2
    if isOk(mid):
        ok = mid
    else:
        ng = mid

print(ok)
import math
n,k = map(int,input().split())
a_list = list(map(int,input().split()))

min_num = 1
max_num = 10**9+1
while True:
    print(min_num)
    x = int((min_num+max_num)/2)
    if sum([math.ceil(a/x)-1 for a in a_list])>k:
        min_num = x
    else:
        max_num = x
    if max_num-min_num<=1:
        break
    #print(x)
if sum([math.ceil(a/min_num)-1 for a in a_list])>k:
    print(int(min_num)+1)
else:
    print(int(min_num))
import math

N,K = map(int, input().split())
A = list(map(int, input().split()))
epsilon = 10**(-9)
#A = [a-epsilon for a in A]

_min = 0
_max = max(A)

while _max - _min < epsilon:
  new = (_min+_max)/2
  if _min < int(new):
    new = int(new)
  times = sum([math.ceil(a/new)-1 for a in A])
  #print(_min, new, _max, times, [math.ceil(a/new)-1 for a in A])
  
  if times <= K:
    _max = new
  else:
    _min = new
  #print(_min, _max)

if  sum([math.ceil(a/_max)-1 for a in A]) <= K:
  print(math.ceil(_max))
else:
  print(math.ceil(_min))
n, k = map(int, input().split())
a = list(map(int, input().split()))

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

l = 1
u = max(a)

while u > l+1:
#    print(l,u)
    c = (l + u) // 2
    cnt = 0
    for i in a:
        cnt = cnt + (i//c)
    if cnt <= k:
        u = c
    else:
        l = c

print(u)
import numpy as np

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

left, right = 1, np.max(a)
while right - left > 1:
    mid = left + (right - left) // 2
    if np.sum(np.ceil(a/mid)-1) <= k:
        right = mid
    else:
        left = mid
print(right)
from math import ceil

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

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

    return right
  
print(binary_search2(C, 1, max(A)))
import sys

n, k, *aaa = map(int, sys.stdin.buffer.read().split())
l = 1
r = max(aaa)
while l + 1 < r:
    m = (l + r) // 2
    if sum((a - 1) // m for a in aaa) > k:
        l = m
    else:
        r = m

print(r)
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+=(A[i]-1)//ans
    if cut>K:
        return False
    else:
        return True


ansp=max(A)
ansm=min(A)
ans=(ansp+ansm)//2
d=1
while ansp-ansm>d:
    
    if judge(ans,K,A):
        ansp=ans
        
    else:
        ansm=ans
        
    ans=(ansp+ansm)//2
print(ansp)