Dang_Quan_10_Tin

TRADER

Jul 4th, 2021
1,437
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.73 KB | None | 0 0
  1. #define taskname ""
  2.  
  3. #include <bits/stdc++.h>
  4.  
  5. #define pb push_back
  6. #define ppb pop_back
  7. #define ppf pop_front
  8. #define pf push_front
  9. #define up upper_bound
  10. #define lp lower_bound
  11. using namespace std;
  12. using ll = long long;
  13. using ld = long double;
  14.  
  15. const int maxn = 1e6 +2;
  16. const int base = 31;
  17. const int mod = 1e9 +7;
  18.  
  19. ll t;
  20.  
  21. int main()
  22. {
  23.     if(fopen(taskname".INP", "r"))
  24.     {
  25.         freopen(taskname".INP", "r", stdin);
  26.         freopen(taskname".OUT", "w", stdout);
  27.     }
  28.     ios_base::sync_with_stdio(false);
  29.     cin.tie(nullptr);
  30.     cout.tie(nullptr);
  31.     cin >> t;
  32.     while(t--)
  33.     {
  34.         ll x, y, k;
  35.         cin >> x >> y >> k;
  36.         cout << (k * (y + 1) - 2) / (x - 1) + 1 + k << '\n';
  37.     }
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment