Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define fast()(ios_base::sync_with_stdio(0),cin.tie(NULL));
- int main()
- {
- ll t;
- cin>>t;
- while(t--)
- {
- ll n,k;
- cin>>n>>k;
- ll x= k/(n-1);
- x*=n;
- if(k%(n-1)==0)x-=1;
- else x+=(k%(n-1));
- if(k<n)x=k;
- cout<<x<<endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement