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

~/algor $ cat problems/aholi-ikki-baravar

Population doubling

Easy 1000 ms 64 MB 28%
Share

A city has $a$ inhabitants. Every year the population grows by $p$ percent: at the end of the year $\lfloor x \cdot p / 100 \rfloor$ people are added, where $x$ is that year's population (people are whole, so the fractional part is dropped). After how many years will the population first reach at least $2a$?

Bars growing year by year and the 2a line; the first year to reach the line is highlighted

Input

One line with two positive integers: $a$ and $p$.

Output

One integer — the number of years.

Note

$1 \le a \le 10^{6}$
$1 \le p \le 100$
$a \cdot p \ge 100$ (at least one person is added every year)

Examples

Input #1
1000 10
Output #1
8
Input #2
100 100
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.