~/algor $ cat problems/aholi-ikki-baravar
Population doubling
Easy
1000 ms
64 MB
28%
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$?
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