peterverebics/CodeNet_Python_118 huggingface dataset:
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 += floor(a[i] / target)
        if now > k:
            lower = target
        else:
            upper = target
    print(max(floor(upper), ceil(lower)) if k > 0 else a[-1])


if __name__ == '__main__':
    main()
def check(A, K, L):
    i = 0
    for a in A:
        i += a//L
        if i > K:
            return False
    return True

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
A.sort(reverse=True)
l = 0
r = A[0]
while l + 1 < r:
    m = (l+r)//2
    if check(A, K, m):
        r = m
    else:
        l = m
print(r)
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 cnt <= K:
        return True
    else:
        return False

ng = 0
ok = max(A)
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 = 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.0001<=(hi+lo)/2<=oldmid+0.0001:
        print(min(math.ceil(lo), max(a)))
        break
    oldmid=mid
import math

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

left = 0
right = A[0]

while right - left > 1:
    mid = (left + right) // 2
    jk = 0
    for i in range(N):
        jk += A[i] / mid - 1
        if A[i] % mid == 0: jk += 1
    if jk <= K:
        right = mid
    else:
        left = mid

print(right)
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.01:
        return right
    middle = (right + left) / 2
    if is_can(middle):
        return binary_search(left, middle)
    else:
        return binary_search(middle, right)
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)))
N, K = map(int,input().split())
A = sorted(map(int,input().split()))
start = 0
end = A[-1]
l = (start + end)/2
while int(end) - start >= 1:
   l = (start + end)/2
   count = 0
   for i in range(N):
      q, mod = divmod(A[i], l)
      if mod == 0.0:
         q -= 1
      count += q
   if count > K:
      start = l
   else:
      end = l
ans = (start + end)/2
print(int(end))
import math

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


def nibun(l, r):
  if r - l < 1:
    return r
  cnt = 0
  x = (r + l) / 2
  for i in a_list:
    cnt += (i-1)//x 
  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))))
n, k = map(int, input().split())
a = list(map(int, input().split()))

def check(x):
  c = 0
  for i in range(n):
    c += a[i]//x
  if c <= k:
    return True
  else:
    return False

mx = max(a)
mn = 0
ans = [mx]
while mn <= mx:
  m = (mx+mn)//2
  if m == 0:
    if check(1):
      ans.append(1)
    break
  if check(m):
    mx = m - 1
    ans.append(m)
  else:
    mn = m + 1
print (min(ans))
from heapq import heappush, heappop, heapify
import math
def solve():
	n , k= map(int, input().strip().split())
	a= [(-int(x),1,int(x)) for x in input().strip().split()]
	heapify(a)
	for i in range(k):
		x,cnt,orig = heappop(a)
		if x < 1:
			return 1
		heappush(a,(-((orig+cnt)//(cnt+1)),cnt+1,orig))
	return -(heappop(a)[0])


print(solve())
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")
ans = int(ans*10)/10
# ~ print(ans)
print(int(ceil(ans)))
n, k = map(int, input().split())
a = list(map(int, input().split()))
a = [x * 2 for x in a]
result = max(a)
left = 1
right = result
med = left + (right - left) // 2
while left <= right:
    counter = sum([x // med for x in a])
    if counter <= k:
        result = med
        right = med - 1
    else:
        left = med + 1
    med = left + (right - left) // 2
print((result + 1) // 2)
#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.1
        Cancut = X
    else:
        low  = X + 0.1
# 出力
print(math.ceil(Cancut))
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
import sys
from math import ceil
def main(N, K, A):
    def cut_times(longest):
        return sum(a // longest for a in A)
    under = 0
    r = 10**9
    for i in range(100):
        m = (under + r) / 2
        if cut_times(m) <= K: r = m
        else: under = m
    print(ceil(r - 10**-10))

if __name__ == '__main__':
    input = sys.stdin.readline
    N, K = map(int, input().split())
    *A, = map(int, input().split())
    main(N, K, A)
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))
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.01:
    ans=((ansp+ansm)/2)
    if judge(ans,K,A):
        ansp=((ansp+ans)/2)
        
    else:
        ansm=((ans+ansm)/2)
        
print(int(ans)+1)
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.01:
        return right
    middle = (right + left) / 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),2)))
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 math.ceil(a) != math.ceil(b):
    c = (a+b)/2
    times = []
    for i in logs:
        times.append(math.floor(i/c))
    if sum(times) > K:
        a = c
    else:
        b = c
    if b - a < 0.001:
        b = round(b)
        break    
print(math.ceil(b))
N, K = map(int, input().split()[:2])
arr = list(map(int, input().split()[:N]))


def pos(X):
    sum = 0
    for i in arr:
        sum += int(i/X)
        if i % X == 0:
            sum -= 1
    return sum <= K


low = 0
high = 10 ** 9
mid = 0
ans = 10**9

while low <= high:
    mid = int((low+high)/2)
    # print(low, mid, high)
    if mid == 0 or pos(mid):
        ans = mid
        high = mid-1
    else:
        low = mid+1
    # print(pos(mid))
print(ans)
import sys
import math
input = sys.stdin.readline

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

def check(x):
    res = 0
    for i in a:
        if i % x == 0:
            res += i // x
        else:
            res += math.floor(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))
import math
N, K = map(int, input().split(' '))
temp = input(). split(' ')
A = []
for item in temp:
    A.append(int(item))

for k in range(K):
    i = A.index(max(A))
    A[i] = A[i]/2

print(math.ceil(max(A)))
N,K = map(int,input().split())
A = list(map(int,input().split()))
L = 0
R = max(A)
while R-L > 0.001:
    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)+1)
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 > 1:
    m = (r+l)//2
    if f(m) <= K:
        r = m
    else:
        l = m

if K == 0:
    print(max(A))
elif f(r) >= K:
    print(r)
else:
    print(l)
import math
n, k = map(int, input().split())
a = list(map(int, input().split()))

l = 0
r = max(a)
mid = (r-l)//2
while not r-l == 1:
    c = 0
    for x in a:
        c += x//mid
    if c > k:
        l = mid
    else:
        r = mid
    mid = l+(r-l)//2
print(r)
import math
n,k = map(int,input().split())
A = list(map(int,input().split()))
x = max(A)
y = 1
while True:
    if x == y:
        print(x)
        break
    z = (x+y)//2
    lst = [math.floor(A[i]/z)-1 for i in range(n)]
    if sum(lst) < k:
        y = z
    else:
        x = z
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)
		heappush(a,(-((orig+cnt)//(cnt+1)),cnt+1,orig))
	return -(heappop(a)[0])
 
 
print(solve())
import math

N,K = map(int, input().split())
A = list(map(int, input().split()))
epsilon = 10**(-15)
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(_min, new, _max, times, [math.floor(a/new) for a in A])
  if times <= K:
    _max = new
  else:
    _min = new
    
print(math.ceil(_max))
import math

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

def isPossible(X):
    global N, K, A

    cuts = 0
    for i in range(N):
        cuts += math.ceil(A[i]/X) - 1
    
    return cuts <= K

minVal = 0
maxVal = max(A)

while maxVal - minVal >= 1:
    if isPossible((maxVal + minVal) / 2):
        maxVal = (maxVal + minVal) / 2
    else:
        minVal = (maxVal + minVal) / 2

print(math.ceil(minVal))
f=lambda:[*map(int,input().split())]
n,k=f()
a=f()
# Binary Search
def ok(x):
    c=0
    for i in a:
      c+=0--i//x
    return c<=n+k
l,r=0,10**9+1
while r-l>10**-2:
  m=(l+r)/2
  if ok(m): r=m
  else: l=m
from math import *
print(ceil(l))
import math

N, K = map(int,input().split())
A_str = input().split()

A = [int(a) for a in A_str]

A.sort(reverse = True)

for i in range(K):
  A[0] /= 2.
  A.sort(reverse=True)
  
min = A[0]
print(math.ceil(min))
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)>0.9:
    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))
#!/usr/bin/env python3
n, k = map(int, input().split())
a = list(map(int, input().split()))


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


ok, ng = 0, max(a) + 1
while abs(ok - ng) > 1:
    m = (ok + ng) // 2
    if f(m) > k:
        ok = m
    else:
        ng = m
print(ok + 1)
N,K=map(int,input().split())
A=list(map(int, input().split()))
l=0
r=max(A)+1
while not l+1==r:
    x=(r+l)//2
    k=0
    for a in A:
        k+=a//x
    if k<=K:
        r=x
    else:
        l=x
print(r)
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+=a//now
        if cnt>k:
            break
    if cnt>k:
        low=now
    else:
        high=now
    #print(cnt,low,high)
print(high)
import copy
import math

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

ub = 10**9
lb = 0

while ub - lb > 10**-6:
    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, 2)
print(math.ceil(ans))
n,k=map(int,input().split())
a=list(map(int,input().split()))
tmax=max(a)
tmin=0
import math
ans=tmax
if k==0:
  print(tmax)
else:
  while True:
    t=(tmax+tmin)/2
    if abs(tmax-tmin)<0.01:
      break
    s=0
    for i in range(n):
      s=s+math.ceil(a[i]/t)-1
    if k>=s:
      ans=min(math.ceil(t),ans)
      tmax=t
    else:
      tmin=t
  print(math.ceil(tmax))
import numpy as np
N,K = map(int, input().split()) 
Logs = np.array([int(x) for x in input().split()])
cut = [1]*N
chip = Logs.copy()
for i in range(K):
  x = np.argmax(chip)
  cut[x]+=1
  chip[x]= Logs[x]/cut[x]

print(int(max(chip)))
import math
N,K=map(int,input().split())
a=list(map(float,input().split()))
lowest=0
highest=max(a)
antemp=0

while True:
    temp=(lowest+highest)/2
    for ans in a:
        antemp+=math.ceil(ans/temp)-1
    if antemp<K:
        highest=temp
    elif antemp>K:
        lowest=temp
    else:
        highest=temp
        if highest-lowest<0.1:
            print(math.ceil(temp))
            exit()
    antemp=0
import sys
import heapq
import math


def input():
    return sys.stdin.readline().rstrip()


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

    while abs(ok - ng) > 1:
        mid = abs(ok + ng) // 2
        count = 0
        for i in range(N):
            count += math.floor(A[i] / mid)
        if count > K:
            ok = mid
        else:
            ng = mid

    print(ng)


if __name__ == "__main__":
    main()
N,K = map(int,input().split())
A = list(map(int,input().split()))

tmp = N+K
sumA = sum(A)
for i in range(1,2*10**5):
    if i*tmp >= sumA:
        print(i)
        exit()
N, K = map(int, input().split())
arr = list(map(int, input().split()))
def f(x):
    res = 0
    for i in range(N):
        res += arr[i]//x
    return res
left = 1
right = max(arr)
while abs(left-right) > 1:
    tmp = (left+right)//2
    if f(tmp) > K:
        left = tmp
    else:
        right = tmp
print(right)
N, K = map(int,input().split())
A = list(map(int,input().split()))
import math

if K != 0:
  ans = ["0" for _ in range(30)]
  for x in range(30):
    ans[x] = "1"
    tmp = int("".join(ans),2)
    sum_cut = sum([math.floor(a/tmp) for a in A])
    if sum_cut <= K:
      ans[x] = "0"
  answer = int("".join(ans),2) + 1
else:
  answer = len([a for a in A if a<=N])
print(answer)
n,k = map(int,input().split())
a = sorted(list(map(int,input().split())))
l = sum(a)//(n+k)
r = a[-1]
while r-l>=1:
  m = (r+l)/2
  if sum([-(-i//m) for i in a]) > n+k:
    l = m
  else:
    r = m
l = -int(-l//1)
r = -int(-1//1)
if sum([-(-i//r) for i in a]) == n+k:
  print(r)
else:
  print(l)
# にぶたん　二分探索
n, k = map(int, input().split())
A = list(map(int, input().split()))

ok = 1
ng = max(A) + 10

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

print(mid)
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))
from math import ceil

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

def flag(upper):
    c = 0
    for a in A:
        c += int(a / upper)
        if c > k:
            return False
    return True

def main():
    A.sort(reverse=True)
    low = 1
    high = A[0]
    while low < high:
        mid = (low + high) // 2
        if flag(mid):
            high = mid
        else:
            low = mid + 1
    print(high)
    return

if __name__ == "__main__":
    main()
import heapq
from decimal import Decimal
from math import ceil
n, k = map(int, input().split())
a = list(map(Decimal, input().split()))
a = list(map(lambda x: - x, a))
heapq.heapify(a)
for _ in range(k):
    tmp = heapq.heappop(a)
    tmp /= 2
    heapq.heappush(a, tmp)

print(ceil(heapq.heappop(a)*-1))
import math
N, K = map(int, input().split())
As = list(map(int, input().split()))


def cut_num(a, cut_length):
    if a % cut_length == 0:
        return (a // cut_length) - 1
    else:
        return a // cut_length


"""binary search
"""
l = 0
r = 10e9


while r-l > 1:
    n = (l+r)/2
    current_cut = sum([cut_num(a, n) for a in As])
    
    if current_cut > K:
        l = n
    else:
        r = n

print(math.ceil(l))
n, k = map(int, input().split())
A = [*map(int, input().split())]
l, r = 0, 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 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 5*10**7 < K:
    print(1)
else:
    for i in range(K):
        m = heapq.heappop(heaplist)
        heapq.heappush(heaplist,(m[2]/(m[1]+1),m[1]+1,m[2]))

# print(A)
print(ceil(-heapq.heappop(heaplist)[0]))
## coding: UTF-8
import bisect

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

l = []
for i in range(N):
    l.append([A[i], A[i], 1])

#print(l)

for i in range(K):
    tmp = l.pop()
    tmp[2] += 1
    tmp[0] = float(tmp[1] / tmp[2])
    bisect.insort(l, tmp)
    #print(l)

ans = l[-1][0]
#print(ans)
if((ans - ans // 1) >= 0.5):
    print(int(ans//1+1))
else:
    print(int(ans//1))
N,K = map(int,input().split())
A = list(map(int, input().split()))

X = list(range(1,N+1))
lo = 1
hi = max(A)

while hi-lo>=2:
    mid = (lo+hi)//2
    
    temp = list(map(lambda x:  x//mid ,A))
    if sum(temp) <= K:
        hi = mid
    else:
        lo = mid

temp = list(map(lambda x:  x//lo ,A))

if sum(temp) <= K:
    print(lo)
else:
    print(hi)
n,k=map(int,input().split())
a=list(map(int,input().split()))
tmax=max(a)
tmin=0
t=(tmax+tmin)/2
import math
ans=0
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=t
      tmax=t
      t=(tmin+t)/2
    else:
      tmin=t
      t=(t+tmax)/2
    if tmax-tmin<0.1:
      break
  print(math.ceil(ans))
n,k=map(int,input().split())
a=list(map(int,input().split()))

l=0
r=1e9+5

while l+1!=r:
    m = (l+r)//2
    cnt = 0
    for x in a:
        cnt += (x-1)//m
    if cnt <= k:
        r = m
    else:
        l = m
print(r)
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 = (right + left) / 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 math
N, K = map(int, input().split())
As = list(map(int, input().split()))


def cut_num(a, cut_length):
    return math.ceil(a/cut_length) - 1


"""cut length N binary search
if cut num > K, search more longer cut length,
"""
l = 1
r = max(As)

ans = r
while r-l > 1:
    m = (l+r)/2
    current_cut_num = sum([cut_num(a, m) for a in As])
    if current_cut_num <= K:
        ans = min(ans, m)
        r = m
    else:
        l = m

print(int(ans))
import bisect
import math
N,K = map(int, input().split())
A = [[i,0] for i in sorted(map(int, input().split()))]

for j in range(K):
    y = A.pop()
    z = y[0]*(y[1]+1)/(y[1]+2)
    zz = y[1]+1
    bisect.insort(A,[z,zz])
print(A)
print(math.ceil(A[-1][0]))
from math import ceil

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

def C(x):
  return sum([(A[i]-1)//x 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 numpy as np
N,K = map(int, input().split()) 
Logs = np.array([int(x) for x in input().split()])
cut = [1]*N
chip = Logs
for i in range(K):
  x = np.argmax(Logs)
  cut[x]+=1
  chip[x]= Logs[x]/cut[x]
print(int(max(chip)))
# E - Logs
import sys
sys.setrecursionlimit(1000000)

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

def rec(l,r):
    global N,K,A
    if l==r:
        return l
    tmp = (l+r)//2
    ans = 0
    for i in range(N):
        ans += A[i]//tmp
    if ans<=K:
        return rec(l,tmp)
    else:
        return rec(tmp+1,r)
    
print(rec(1,max(A)))
n,k = list(map(int,input().split()))
f = list(map(int,input().split()))

s = (10**9) // 2
step = s
best= 999999999999
import math

for j in range(50):
  c = 0
  arr = list(f)
  for i in range(n):
    c += arr[i] // s
    arr[i] /= (c+1)
    
  step = step//2
  step = max(1, step)
 
  if c<=k:
    s -= step
    best = min(best,math.ceil(max(arr)))
  else:
    s += step
    
  if s==0:
    s=1
      
print(best)
N, K = map(int, input().split())
A = sorted(list(map(int, input().split())))

def check(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(m)
    if ok: # 
        answer=m
        hi=m
    else:
        lo=m+1
for l in range(max(1, answer-10),answer+1):
    if check(l):
        answer = l
print(min(max(A), answer))
A,B,C = map(int, input().split())
K = int(input())
ctr = 0
while B <= A:
    B *= 2
    ctr += 1
while C <= B:
    C *= 2
    ctr += 1
print('Yes' if K >= ctr else 'No')
a, b, c = map(int, input().split())
k = int(input())

if b > a:
  multiplier = 2 ** k
  if c * multiplier > b:
    ans = 'Yes'
  else:
    ans = 'No'
else:
  while b <= a:
    b *= 2
    k -= 1
  multiplier = 2 ** k
  if c * multiplier > b:
    ans = 'Yes'
  else:
    ans = 'No'

print(ans)
A, B, C = map(int, input().split(' '))
K = int(input())

while K > 0:
    if B > A:
        break
    B *= 2
    K -= 1

while K > 0:
    if C > B:
        break
    C *= 2
    K -= 1

if A < B < C:
    print('Yes')
else:
    print('No')
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
count = 0
ans = "No"

A,B,C = I()
K = i()

while True:
    if B > A or K == 0:
        break
    else:
        B *= 2
        K -= 1
while True:
    if C > B or K == 0:
        break
    else:
        C *= 2
        K -= 1
if A < B and B < C:
    ans = "Yes"
print(ans)
a,b,c = map(int, input().split())
k = int(input())
key = 0

for i in range(0,k+1):
    if i == 0:
        cc = c
    else:
        cc = c*(2**i)
    
    if k-i == 0:
        bb = b
    else:
        bb = b*(2**(k-i))
    
    if cc > bb and bb > a:
        key = 1
        break

if key == 1:
    print("Yes")
else:
    print("No")