Advertisement
Saleh127

CF 1418A

Sep 14th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9. ///!@]}
  10.  
  11. test
  12. {
  13.  
  14. ll x,y,n,k,a,c,d,e,f,i,j,l;
  15.  
  16. cin>>x>>y>>k;
  17.  
  18. n=(y*k)+k-1;
  19. d=k;
  20.  
  21. if((n)%(x-1)==0) e=(n)/(x-1);
  22. else e=1+(n)/(x-1);
  23.  
  24. cout<<d+e<<endl;
  25.  
  26. }
  27.  
  28.  
  29. return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement