1044:Music

时间限制: 2 S | 内存限制: 65536 KB
Accept: 0 | Submit: 0
[提交] [状态] [讨论版]
描述

01 loves listening to music via his smartphone. But the smartphone doesn't have much memory, so 01 listens to his favorite songs in a famous website.

Unfortunately, internet is not that fast and the song takes a lot of time to download. But 01 is quite impatient. The song's duration is T seconds. 01 downloads the first S seconds of the song and plays it. When the playback reaches the point that has not yet been downloaded, 01 immediately plays the song from the start (the loaded part of the song stays in his phone, and the download is continued from the same place), and it happens until the song is downloaded completely and 01 listens to it to the end. For q seconds of real time the Internet allows you to download q - 1 seconds of the track.

Tell 01, for how many times he will start the song, including the very first start.

输入

The single line contains three integers T, S, q (2 ≤ q ≤ 10^4, 1 ≤ S<=T ≤ 10^5).

输出

Print a single integer — the number of times the song will be restarted.

样例输入

5 2 2

5 4 7

样例输出

2

1

HINT
In the first test, the song is played twice faster than it is downloaded, which means that during four first seconds 01 reaches the moment that has not been downloaded, and starts the song again. After another two seconds, the song is downloaded completely, and thus, 01 starts the song twice. In the second test, the song is almost downloaded, and 01 will start it only once.
来源
XUJC OJ