Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/qidiruv-olma-yeyish

Apple-eating speed

Medium 1000 ms 128 MB 58%
Share

There are apples in $n$ baskets: $a_{i}$ apples in the $i$-th basket. A boy eats at most $v$ apples per hour: each hour he chooses one basket and eats $v$ apples from it (if fewer than $v$ are left in the basket, he eats them all and eats no other apples for the rest of that hour). What is the smallest $v$ that lets him eat all the apples within $h$ hours?

Basket columns: each split into parts of v, the total number of hours compared with the limit

Input

The first line contains two positive integers: $n$ and $h$.
The second line contains $n$ positive integers $a_{i}$.

Output

One positive integer — the smallest $v$.

Note

$1 \le n \le 2 \cdot 10^{4}$
$n \le h \le 10^{9}$
$1 \le a_{i} \le 10^{9}$

Examples

Input #1
4 8
3 6 7 11
Output #1
4
Input #2
3 3
5 1 9
Output #2
9

Sign in to submit a solution

Signing up is free and takes a minute.