Niloy007

K-th Not Divisible by n || Codeforces

May 10th, 2020
109
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int t, n, k;
  6.     cin >> t;
  7.     while(t--) {
  8.         cin >> n >> k;
  9.         double div = (k - 1) / (double) (n - 1);
  10.         int result = k + floor(div);
  11.         cout << result << endl;;
  12.     }
  13.  
  14.     return 0;
  15. }
RAW Paste Data