http://codeforces.com/contest/569/problem/A
水题,,模拟一下就好了,每q秒计算一次
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <iostream>
#include <queue>
#include <map>
#include <set>
#include <vector>
using namespace std;
const int maxn=100010;
int main()
{
int t,s,q;
cin>>t>>s>>q;
int n1=t-s;
int n2=n1/(q-1);
if (n1%(q-1)!=0)
n2++;
if (q-1>n1)
{
printf("1\n");
return 0;
}
int cops=s;
int cun=1;
int left=s;
while(n1>0)
{
if (left>=1)
{
left=left-1;
n1-=q-1;
}
else
{
left=left+(t-n1);
cun++;
}
}
printf("%d\n",cun);
return 0;
}