peterverebics/CodeNet_Python_118 huggingface dataset:
N,K = [int(hoge) for hoge in input().split()]
A = [int(hoge) for hoge in input().split()]
#割り当てを考えた後は、n等分するのが最適→にぶたん？
NG = 0
OK = 10**9 + 100
#小数点以下切り上げ→最小となるOKのintを求める
def Maruta(L):#長さLにできるか
    Kaisu = sum([a//L - 1 +  bool(a%L) for a in A])
    return Kaisu<=K

while OK - NG > 1:
    Test = (OK + NG)//2
    if Maruta(Test):
        OK = Test
    else:
        NG = Test
print(OK)
# coding: utf-8
import numpy as np


def solve(*args: str) -> str:
    n, k = map(int, args[0].split())
    A = np.array(tuple(map(int, args[1].split())))

    l, r = 0, np.max(A)
    while l+1 < r:
        m = (l+r)//2
        if k < np.sum(-(-A//m)-1):
            l = m
        else:
            r = m

    return str(r)


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))
import math

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

def ink(L):
    cnt = 0
    for i in range(N):
        cnt += A[i]//L
        if A[i]%L != 0:
            cnt += 1
        cnt -= 1
    return cnt <= K

bottom, top = 0, max(A)

while(top - bottom > 1):
    middle = (top + bottom) // 2
    if ink(middle): top = middle
    else: bottom = middle

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

left = 0
right = 10**9

while right - left > 1:
    center = (right+left)//2
    count = 0
    for a in A:
        if a%center == 0:
            count += a//center-1
        else:
            count += a//center
            
    if count >  K:
        left = center
    else:
        right = center
        
print(right)
import math

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

l, r = 0, 10**9+2

while r-l > 1:
  key = (r+l)//2
  count = 0
  for i in range(n):
    count += (a[i]-1)//key
  if count <= k:
    r = key
  else:
    l = key

print(r)
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)
while l < r:
    m = (l + r) >> 1
    if f(m) > k:
        l = m + 1
    else:
        r = m
print(r)
from sys import stdin

def main():
    n, k = map(int, stdin.readline().split())
    a = list(map(int, stdin.readline().split()))
    
    def ok(ans):
        cnt = sum(max((i - 1) // ans, 0) for i in a)
        # print(ans, cnt) 
        return cnt <= k
    
    ans = 0
    for i in range(32, -1, -1):
        if not ok(ans + (1 << i)):
            ans += 1 << i
    print(ans + 1)

main()
N,K = list(map(int,input().split()))
A = list(map(int,input().split()))
 
NG=0
OK=max(A)+1
 
while OK-NG>1:
    mid = (OK+NG)//2
    cur=0
    for x in A:
        cur += (x-1)//mid
    if cur > K:
        NG=mid
    else:
        OK=mid
print(OK)
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] - 1) // 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)
import math
n, k = map(int, input().split())
arr = list(map(int, input().split()))

max_length = max(arr)
low = 1
high = max_length - 1

while low <= high:
  mid = (low + high) //2
  cnt = 0
  for i in range(n):
    cnt += math.ceil(arr[i]/mid) - 1
  if cnt > k:
    low = mid + 1
  else:
    high = mid -1
    max_length = mid

print(max_length)
import numpy as np

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

left, right = 0, 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)
import heapq
import bisect

n,k=map(int, input().split())
A=[int(i) for i in input().split()]
ng=0
ok = max(A)
while(ng+1!=ok):
    mid = (ok+ng)//2
    ans = 0
    for i in A:
        ans += 0--i//mid-1
    if(ans<=k):
        ok = mid
    else:
        ng = mid
print(ok)
N, K = map(int, input().split())
A = list(map(int, input().split()))

def is_ok(n):
    cnt = 0
    for a in A:
        if n >= a:
            continue
        cnt += a // n
    return cnt <= K

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

print(meguru_bisect(0, 10**9+1))
n, k = map(int, input().split())
a = list(map(int, input().split()))
result = max(a)
left = 1
right = result
med = left + (right - left) // 2
while left <= right:
    counter = sum([(x - 1) // med for x in a])
    if counter <= k:
        result = med
        right = med - 1
    else:
        left = med + 1
    med = left + (right - left) // 2
print(result)
import heapq

n, k = map(int, input().split())
a = [int(i) for i in input().split()]
ok = 10**9
ng = 0
while abs(ng-ok) > 1:
    m = (ok+ng)//2
    cou = 0
    for i in a:
        cou += (i+m-1)//m-1
    if cou <= k:
        ok = m
    else:
        ng = m
print(ok)
def isok(A, X, k):
    cnt = 0
    for a in A:
        cnt += (a+X-1)//X-1
    return True if cnt <= k else False


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

# 答えを二分探索
left = 0 # 条件をみたさない
right = 10**9 # みたす

while right-left > 1:
    mid = left + (right-left)//2
    if isok(A, mid, K):
        right = mid
    else:
        left = mid

print(right)
import math
from heapq import heappop
import heapq
N, K = map(int, input().split())
A = list(map(int, input().split()))

l = 0
r = max(A)+1

while(l+1 < r):
    m = (l+r)//2
    tmp = 0
    for a in A:
        tmp += math.ceil(a / m)-1
    if tmp <= K:
        r = m
    else:
        l = m

print(r)
import math
def is_lt_or_e_K(k, x, a):
    if k >= sum([math.ceil(i / x) - 1 for i in a]):
        return True
    else:
        return False 
n, k = map(int, input().split())
a = list(map(int, input().split()))
high = max(a)
low = 0
while 1:
    if high - low < 2:
        break
    x = (high + low) // 2
    if is_lt_or_e_K(k, x, a):
        high = x
    else:
        low = x
print(high)
from math import ceil

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

l_lb, l_min = 0, max(A)
while l_min - l_lb > 1:
  l_mid = (l_lb + l_min) // 2
  if sum(ceil(a/l_mid) for a in A) - N > K:
    l_lb = l_mid
  else:
    l_min = l_mid
print(l_min)
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))
mini = 0
maxi = max(A)
while maxi - mini > 1:
    mid = (maxi+mini)//2
    s = sum(math.ceil(a/mid)-1 for a in A)
    if s>K:
      mini = mid
    else:
      maxi = mid
print(mini+1)
def meg_bisect(ng, ok, func):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if func(mid):
            ok = mid
        else:
            ng = mid
    return ok

n, k, *a = map(int, open(0).read().split())
print(meg_bisect(0, max(a), lambda x: sum(0--b // x - 1 for b in a) <= k))
def bisect(ng, ok, judge, eps=1):
    while abs(ng-ok) > eps:
        m = (ng+ok)//2
        if judge(m):
            ok = m
        else:
            ng = m
    return ok

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

K += N
def judge(d):
    return sum((a-1)//d+1 for a in A) <= K


for d in range(1,7):
    r = sum((a-1)//d+1 for a in A)

res = bisect(0,max(A),judge)
print(res)
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(top)
from math import *
f=lambda:[*map(int,input().split())]
n,k=f()
a=f()
def ok(x):
  c=0
  for i in a:
    c+=ceil(i/x)
  return c<=n+k
l,r=0,10**9
while r-l>1:
  m=(l+r)/2
  if ok(m): r=m
  else: l=m
t=ceil(r)
print(t-ok(t-1) if t>1 else t)
BIG = 10**10

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

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

A = [a*BIG for a in A]

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

# print(c)

print(-(-ok//BIG))
n, k = map(int, input().split())
alst = list(map(int, input().split()))

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

l = 1
r = max(alst)

while r != l:
    pos = (r + l) // 2
    cnt = 0
    for a in alst:
        cnt += (a - 1) // pos
    if cnt <= k:
        r = pos
    else:
        l = pos + 1
print(r)
from math import ceil


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

    def check(Min):
        kill = 0
        for a in A:
            kill += (ceil(a/Min)-1)
        return kill <= K

    l = 0
    r = 1000000000

    while r-l > 1:
        mid = (l+r)//2
        if check(mid):
            r = mid
        else:
            l = mid
    print(r)
        


if __name__ == '__main__':
    main()
import math

def main():
    N, K = map(int, input().split())
    As = list(map(int, input().split()))

    l = 0
    r = 10**9

    while (r - l) >= 10**(-6):
        m = (l + r) / 2
        t = 0
        for A in As:
            t += math.ceil(A / m - 1)
            if t > K:
                break

        if t <= K:
            l, r = l, m
        else:
            l, r = m, r

    print(math.ceil(l))

main()
def main():
    import sys
    def input(): return sys.stdin.readline().rstrip()
    n , k = map(int, input().split())
    a = list(map(int, input().split()))
    l = 1
    r = max(a)
    while l < r:
        m = (l+r)//2
        cnt = 0
        for x in a:
            cnt += (x-1)//m
        if cnt > k: l = m+1
        else: r = m
    print(r)
    


if __name__ == '__main__':
    main()
import math
N,K = map(int,input().split())
A = list(map(int,input().split()))
max_a = max(A)
u = max_a
d = 0
res = 9
max_do = math.ceil(math.log(max_a*10,2))
for _ in range(max_do):
    n = (u + d)/2
    _k = 0
    for _a in A:
        _k += math.ceil(_a/n) - 1
    
    if _k > K:
        d = n
    else:
        u = n
print(math.ceil(n))
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 = 10000000000
ng = 0
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())
logs = list(map(int, input().split()))
maxL = max(logs)

minz = 0
maxz = maxL+1
while minz < maxz-1:
    midz = (maxz + minz)//2
    ncut = 0
    for i in range(N):
        thiscut = int((logs[i] + midz - 1) / midz) - 1
        ncut += thiscut

    if ncut > K:
        minz = midz
    else:
        maxz = midz

print(maxz)
import math

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

def check(L):
    return sum(math.ceil(a / L)-1 for a in A) <= K

answer=max(A)
lo = 1
hi = answer+1
while lo < hi:
    m = (lo + hi)//2
    ok = check(m)
    if ok: 
        answer=min(m, answer)
        hi=m
    else:
        lo=m+1
print(answer)
def is_ok(X):
    cnt = 0
    for a in A:
        cnt += -(-a//X)-1
    if cnt <= k:
        return True
    else:
        return False


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

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

print(meguru_bisect(0,max(A)+1))
'''
Date         : 2020-08-09 00:46:52
Author       : ssyze
Description  : 
'''
n, k = map(int, input().split())
a = list(map(int, input().split()))


def check(m):
    sum = 0
    for i in range(len(a)):
        sum += (a[i] - 1) // m
    if sum > k:
        return False
    else:
        return True


l = 1
r = 10**9
ans = 10**9
while l < r:
    mid = (l + r) // 2
    if check(mid) == 1:
        r = mid
        ans = mid
    else:
        l = mid + 1
print(ans)
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(math.ceil(left))
def is_ok(mid):
    cnt = 0
    for i in range(n):
        cnt += (a[i] - 1) // mid
    return cnt <= k

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

ok = 10 ** 18
ng = 0
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if is_ok(mid):
        ok = mid
    else:
        ng = mid
print(ok)
n, k = map(int, input().split())
a = list(map(int, input().split()))
l = 0
r = max(a)
while r - l > 1:
    # min is in (l, r]
    c = (l + r) // 2
    t = 0
    for ai in a:
        t += (ai + c - 1) // c - 1
    if t <= k:
        r = c
    else:
        l = c
print(r)
from math import *
f=lambda:[*map(int,input().split())]
n,k=f()
a=f()
def ok(x):
  c=0
  for i in a:
    c+=ceil(i/x)
  return c<=n+k
l,r=0,10**9+1
while r-l>0.1:
  m=(l+r)/2
  if ok(m): r=m
  else: l=m
t=ceil(r)
print(t-ok(t-1) if t>1 else t)
import numpy as np
N, K = map(int, input().split())
A = np.array(input().split(), dtype=np.int64)


l = 0
r = 2 * 10 ** 9 + 10 ** 6
while r - l > 1:
    m = (r + l) // 2
    cnt = ((A + m - 1) // m).sum()
    if cnt <= N + K:
        r = m
    else:
        l = m

print(r)
f=lambda:map(int,input().split())
N,K=f()
A=list(f())

def isOK(X):
    if X<=0:
        return False
    return sum([-a//X*-1-1 for a in A])<=K


ok=10**10
ng=-1
while abs(ok-ng)>1:
    mid=(ok+ng)//2
    if isOK(mid):
        ok=mid
    else:
        ng=mid
print(ok)
from math import ceil
n,k = map(int,input().split())
a = list(map(int,input().split()))

def cut(x):
  t = 0
  for i in a:
    if i <= x:
      continue
    t += ceil(i / x) - 1
  return t <= k

l,r=0,10**9
while l+1 < r:
  x = l + (r-l)//2
  if cut(x):
    r = x
  else:
    l = x
print(r)
from math import ceil

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

l = 0
r = 10**9
ans = 0
while l+1 < r:  
  m = (l+r)//2  
  c = 0
  for a in A:
    c += ceil(a/m)-1
  if c <= k:
    ans = min(ans,m)
    r = m
  else:
    l = m
  
print(r)
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))
n, k = map(int, input().split())
a = list(map(int, input().split()))

l = 0
r = 10**9 + 1
ref = 0
ans = 10**9

while r - l > 1:
    now = (l + r)//2
    for i in a:
        ref += 0 - -i//now - 1
    if ref <= k:
        ans = now
        ref = 0
        r = now
    else:
        ref = 0
        l = now
print(ans)
N, K = map(int, input().split())
A = list(map(int, input().split()))

def check(l):
    k = 0
    for a in A:
        k += (a-1)//l
    return k<=K

max_ng = 0
min_ok = 10**9
while min_ok-max_ng>1:
    tgt = (min_ok+max_ng)//2
    if check(tgt):
        min_ok = tgt
    else:
        max_ng = tgt

print(min_ok)
n,k=map(int,input().split())
a=list(map(int,input().split()))
def ok(l):
    cnt = 0
    for L in a:
        cnt += L//l
        if L%l != 0:
            cnt +=1
        cnt-=1
    return cnt<=k

bot,top=0,max(a)
while top - bot >1:
    mid = (top + bot) //2
    if ok(mid): top = mid
    else: bot = mid
print(top)
N, K = map(int, input().split())
a = list(map(int, input().split()))
max_a = 10**9
min_a = 0

while max_a-min_a>1:
    count = K
    mean_a = (max_a+min_a)//2
    
    for i in range(N):
        if a[i]<=mean_a: continue
        count -= a[i]//mean_a
    if count >= 0:
        max_a = mean_a
    else:
        min_a = mean_a

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

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

ng = 0
ok = 10**9
while ok - ng > 1:
    mid = (ok + ng) // 2
    if is_ok(mid):
        ok = mid
    else:
        ng = mid
print(ok)
n, k = map(int, input().split())
a = sorted(list(map(int, input().split())))[::-1]

l = 0
r = a[0] + 1
ref = 0
ans = a[0]

while r - l > 1:
    now = (l + r)//2
    for i in a:
        ref += 0 - -i//now - 1
        if ref > k:
            ref = 0
            l = now
            break
    else:
        ans = min(ans, now)
        ref = 0
        r = now
print(ans)
def solve(a): #長さaにするのに何回いるか
  ret = 0
  for x in A:
    if x%a == 0:
      temp = x//a-1
    else:
      temp = x//a
    ret += temp
  return ret

N,K = map(int,input().split())
A = list(map(int,input().split()))
total = N+K
Sum = sum(A)
MAX = pow(10,9)+10
ng = 0
ok = MAX
while abs(ok-ng) > 1:
  mid = (ok+ng)//2
  if solve(mid) <= K:
    ok = mid
  else:
    ng = mid
print(ok)
#print(solve(3))
import bisect
n,k = map(int, input().split())
a = sorted(list(map(int, input().split())))

def cnt(x):
  ret = 0
  for ai in a:
    ret += (ai+(x-1))//x - 1
  return ret

ok, ng = a[-1], 0
while ok - ng > 1:
  nw = (ok + ng) // 2
  if cnt(nw)<=k:
    ok = nw
  else:
    ng = nw
    
print(ok)
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))

def check(k):
    cnt = 0
    for a in A:
        cnt += math.ceil(a/k) - 1
    return cnt <= K

l, r = 0, 10**10
while r - l > 1:
    mid = (r + l) // 2
    if check(mid):
        r = mid
    else:
        l = mid

print(r)
n,k = map(int,input().split())
l = list(map(int,input().split()))
l.sort()
x,y=0,10**9
while y>x+1:
    m = (x+y)//2
    c=0
    for i in l:
        c+=(i-1)//m
    if c<=k:
        y=m
    else:
        x=m
print(y)
import math

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

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

low=1
high=max(A)

while low!=high:
    mid=(low+high)//2
    s=0
    for i in range(n):
        s+=math.ceil(A[i]/mid)-1
    if s>k:
        low=mid+1
    else:
        high=mid


print(low)
n,k = map(int,input().split())
a = [int(i) for i in input().split()]
l = 0
r = 10**9
while l+1 < r:
    m = (l+r)//2
    cnt = 0
    for i in range(n): cnt += (a[i]+m-1)//m-1
    if cnt > k: l = m
    else: r = m
print(r)
from math import ceil


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


if __name__ == '__main__':
    main()
import math
n,k = map(int,input().split())
l = list(map(int,input().split()))
def cnt_check(longest):
    if longest == 0:
        return False
    cnt = 0
    for log in l:
        cnt += math.ceil(log/longest)-1
    if cnt <= k:
        return True
    else:
        return False
left = 0
right = max(l)
while right - left > 1:
    middle = (left + right)//2
    if cnt_check(middle):
        right = middle
    else:
        left = middle
print(right)
n, k = map(int, input().split())
a = list(map(int, input().split()))

inf = 1
sup = max(a)

while inf < sup:
  x = (inf + sup) // 2
  cut = 0
  for a_i in a:
    cut += (a_i - 1) // x
  if cut <= k:
    sup = x
  else:
    inf = x + 1
print(sup)
n,k=map(int,input().split())
a=list(map(int,input().split()))

a_max=max(a)

min1=0
max1=a_max

while max1-min1>1:
  zantei=(min1+max1)//2
  ans=0
  for x in range(n):
    if a[x]%zantei==0:
      ans+=a[x]//zantei-1
    else:
      ans+=a[x]//zantei
  if ans<=k:
    max1=zantei
  else:
    min1=zantei
    
print(max1)
def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    _, K = read_ints()
    A = read_ints()
    low, high = 0, max(A)+1
    while high-low > 1:
        mid = low+(high-low)//2
        # max log should be mid
        # 10, maximum log is 4
        required_cuts = sum((a-1)//mid for a in A)
        if required_cuts <= K:
            high = mid
        else:
            low = mid
    return high


if __name__ == '__main__':
    print(solve())
n,k=map(int,input().split())
a=list(map(int,input().split()))
l,r=0,max(a)
def test(x):
  num=0
  for i in a:
    num+=i//x
    if i%x==0:
      num-=1
  if num<=k:
    return num
while r-l>1:
  mid=(l+r)//2
  if test(mid):
    r=mid
  else:
    l=mid
print(r)
n,k=[int(i) for i in raw_input().split()]
a=[int(i) for i in raw_input().split()]
s=0
for i in a:
    s+=i
val=(s+n+k-1)/(n+k)
for i in a:
    k-=i/val
if(k>=0):
    print val
else:
    k=abs(k)
    l=[]
    for i in a:
        x=i/val
        if(x>0):
            l.append((i+x-1)/x)
    l.sort()
    print l[k-1]
import sys
input = sys.stdin.readline

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

OK=10**9
NG=0

while OK-NG>1:
    mid=(OK+NG)//2

    ANS=0
    for a in A:
        ANS+=(a-0.01)//mid

    if ANS<=K:
        OK=mid
    else:
        NG=mid
print(OK)
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)// 2
    num = 0
    for i in a:
        num += (i-1)// mid
    if num <= k:
        ri = mid
    else:
        le = mid
print(ri)
N, K = map(int, input().split())
A = list(map(int, input().split()))


l = 0
r = 10 ** 9 + 1

while r - l > 1:
    m = (r + l) // 2
    cnt = 0
    for i in A:
        cnt += i // m
        if i >= m and i % m == 0:
            cnt -= 1
    if cnt <= K:
        r = m
    else:
        l = m

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

l , r = 0, max(a)

def ok(L):
  cnt = 0
  for i in a:
    cnt += i // L
    if i % L == 0:
      cnt -= 1
  return cnt <= k

while r - l > 1:
  mid = (r + l) //2

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

print(r)
n,k=map(int, input().split())
a = list(map(int, input().split()))
a=sorted(a,reverse=True)
if k==0:
    print(max(a))
    exit()
import math
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.000001<=(hi+lo)/2<=oldmid+0.000001:
        print(min(math.ceil(lo), max(a)))
        break
    oldmid=mid
N,K = map(int,input().split())

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

def check(x):
  k = 0
  for a in A:
    k += ((a-1) // x)
  return k <= K

ng,ok = 0, 10**9+1

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

  if check(x):
    ok = x
  else:
    ng = x

print(ok)
n, k = map(int, input().split())
aes = list(map(int, input().split()))

bottom, top = 0, max(aes)

def ok(l):
  cnt = 0
  for a in aes:
    if a % l == 0:
      cnt += a // l - 1
    else:
      cnt += a // l
  return cnt <= k

while top - bottom > 1:
  mid = (bottom + top) // 2
  if ok(mid):
    top = mid
  else:
    bottom = mid

print(top)
import sys
input = lambda: sys.stdin.readline().rstrip("\r\n")

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

left = 0
right = 10**9 + 1

while right - left > 1:
    mid = (right + left) // 2
    cnt = 0
    for b in a:
        cnt += b // mid + int(b % mid != 0) - 1
    if cnt <= k:
        right = mid
    else:
        left = mid
print(right)
n,k = map(int,input().split())
A = list(map(int,input().split()))

def is_ok(s):
    cnt = 0
    for i in range(n):
        cnt += (A[i]-1)//s
    return cnt<=k
def main():
    left = 0
    right = max(A)
    while (right-left)>1:
        mid = (right+left)//2
        if is_ok(mid):
            right = mid
        else:
            left = mid
    return right
print(main())