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

~/algor $ cat problems/qidiruv-printerlar

Printers

Medium 1000 ms 128 MB 56%
Share

$n$ printers work at the same time: the $i$-th printer prints one page in $t_{i}$ seconds and immediately moves on to the next one. All of them start at second $0$. What is the smallest number of seconds needed to print $m$ pages in total?

For each printer, cells of printed pages along a time axis; the moment when all pages are ready is highlighted

Input

The first line contains two positive integers: $n$ and $m$. The second line contains $n$ positive integers $t_{i}$ separated by spaces.

Output

One integer — the smallest time (in seconds).

Note

$1 \le n \le 10^{5}$
$1 \le m \le 10^{9}$
$1 \le t_{i} \le 10^{4}$

Examples

Input #1
3 7
2 3 5
Output #1
8
Input #2
1 4
6
Output #2
24

Sign in to submit a solution

Signing up is free and takes a minute.