1 solutions
-
0
#include <bits/stdc++.h> using namespace std; void solve(){ int n,k; cin >> n >> k; int ans = k + k/(n-1) ; if(k % (n-1)){ cout << ans << endl; }else{ cout << ans - 1 << endl; } } signed main(){ ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); int T = 1; cin >> T; while(T--){ solve(); } return 0; }
- 1
Information
- ID
- 482
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 7
- Tags
- (None)
- # Submissions
- 59
- Accepted
- 12
- Uploaded By