1052:Music

时间限制:2 S   /  内存限制:65536 KB
AC:23   /  Submit:47
问题描述

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

提示说明
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.
相关

round2


Copyright 2016 - 2024 XUJC ACM Team
闽ICP备2020022076号-1