fork download
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int T,i,time;
  6. long long n,m,k,loc;
  7. for(i=0;i<T;i++)
  8. {
  9. cin>>n>>m>>k;
  10. loc=1;
  11. while(loc!=n)
  12. {
  13. loc=loc+m;
  14. loc-=k;
  15. time+=1;
  16.  
  17. }
  18. cout<<time;
  19. }
  20. return 0;
  21. }
Success #stdin #stdout 0s 2724KB
stdin
1
4 2 1
stdout
Standard output is empty