#CCBOTPBA0000052. Tháng đạt mục tiêu tăng trưởng (Month to Reach a Growth Target)

Tháng đạt mục tiêu tăng trưởng (Month to Reach a Growth Target)

Month to Reach a Growth Target

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem Statement

An initial amount of capital is vv. At the end of each month, it grows by pp percent of its value at the beginning of that month; each increase is reinvested before the next month. Find the smallest number of months kk from 00 through 10001000 such that the capital after kk months is at least the target TT. If the initial amount already meets the target, the answer is 00. If it is still below the target after 10001000 months, print −1-1.

Input

One line contains three real numbers vv, TT, and pp: the initial capital, the target, and the monthly percentage growth rate, in that order.

Output

Print one integer: the minimum kk with 0≤k≤10000\le k\le1000 and capital after kk months at least TT; print −1-1 if no such kk exists.

Subtasks

  • Subtask 1 (20%): 0≤v,T≤106, T≤v, 0<p≤1000\le v,T\le10^6,\ T\le v,\ 0<p\le100.
  • Subtask 2 (30%): 0≤v,T≤106, 1≤p≤1000\le v,T\le10^6,\ 1\le p\le100.
  • Subtask 3 (50%): 0≤v,T≤106, 0<p≤1000\le v,T\le10^6,\ 0<p\le100.

Examples

Example 1

Input:

100 121 10

Output:

2

Explanation: At month 00, the capital is 100<121100<121. After month 11 it is 110110. After month 22 it is 121121, meeting the target for the first time. Print 22.

Example 2

Input:

150 100 5

Output:

0

Explanation: The initial amount 150150 is already at least 100100, so no month is needed.

Example 3

Input:

0 1 100

Output:

-1

Explanation: The capital remains 00 after every month, so it never reaches 11 within 10001000 months.