Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define taskname ""
- #include <bits/stdc++.h>
- #define pb push_back
- #define ppb pop_back
- #define ppf pop_front
- #define pf push_front
- #define up upper_bound
- #define lp lower_bound
- using namespace std;
- using ll = long long;
- using ld = long double;
- const int maxn = 1e6 +2;
- const int base = 31;
- const int mod = 1e9 +7;
- ll t;
- int main()
- {
- if(fopen(taskname".INP", "r"))
- {
- freopen(taskname".INP", "r", stdin);
- freopen(taskname".OUT", "w", stdout);
- }
- ios_base::sync_with_stdio(false);
- cin.tie(nullptr);
- cout.tie(nullptr);
- cin >> t;
- while(t--)
- {
- ll x, y, k;
- cin >> x >> y >> k;
- cout << (k * (y + 1) - 2) / (x - 1) + 1 + k << '\n';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment