You are given two positive integers $n$ and $k$. Print the $k$-th positive integer that is not divisible by $n$.

For example, if $n=3$, and $k=7$, then all numbers that are not divisible by $3$ are: $1, 2, 4, 5, 7, 8, 10, 11, 13 \dots$. The $7$-th number among them is $10$.


-----Input-----

The first line contains an integer $t$ ($1 \le t \le 1000$) — the number of test cases in the input. Next, $t$ test cases are given, one per line.

Each test case is two positive integers $n$ ($2 \le n \le 10^9$) and $k$ ($1 \le k \le 10^9$).


-----Output-----

For each test case print the $k$-th positive integer that is not divisible by $n$.


-----Example-----
Input
6
3 7
4 12
2 1000000000
7 97
1000000000 1000000000
2 1

Output
10
15
1999999999
113
1000000001
1
[{"code": "for _ in range(int(input())):\n    n, k = list(map(int, input().split()))\n    k -= 1\n    print(k//(n-1)*n+k % (n-1)+1)\n", "passed": true, "time": 0.15, "memory": 14204.0, "status": "done"}, {"code": "import math \nfor i in range(int(input())):\n    n,k=list(map(int,input().split()))\n    e=math.ceil(k/(n-1))-1\n    print(k+e)\n", "passed": true, "time": 0.59, "memory": 14128.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n\tn, k = map(int, input().split())\n\tprint(n * ((k-1) // (n-1)) + ((k-1) % (n-1)) + 1)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    n, k = list(map(int, input().split()))\n    num = k // (n - 1)\n    if k % (n - 1) == 0:\n        ans = num * n - 1\n    else:\n        ans = num * n + k % (n - 1)\n    print(ans)", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "for t in range(int(input())):\n    n, k = list(map(int, input().split()))\n    if k % (n - 1) == 0:\n        print(k // (n - 1) * n - 1)\n    else:\n        print(k // (n - 1) * n + k % (n - 1))", "passed": true, "time": 0.65, "memory": 14140.0, "status": "done"}, {"code": "def f(x, n):\n    return x // n\n\ndef ff(l, r, n):\n    return f(r, n) - f(l - 1, n)\n\nfor _ in range(int(input())):\n    # n = int(input())\n    # arr = list(map(int, input().split()))\n    n, k = list(map(int, input().split()))\n    k -= 1\n    s = 1\n    while k > 0:\n        nk = ff(s, s + k, n)\n        s += k\n        k = nk\n        if s % n == 0:\n            s -= 1\n        if k == 1:\n            k = 0\n            s += 1\n            if s % n == 0:\n                s += 1\n\n    print(s)\n", "passed": true, "time": 0.15, "memory": 14248.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n    n, k = map(int, input().split())\n\n    ans = n*(k//(n-1))\n    if k%(n-1)==0:\n        ans -= 1\n    else:\n        ans += k%(n-1)\n\n    print(ans)", "passed": true, "time": 0.14, "memory": 14148.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n    n, k = list(map(int, input().split()))\n    k -= 1\n    out = (k % (n - 1))\n    k //= (n - 1)\n    out += k * n\n    out += 1\n    print(out)\n", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "t = int(input())\nfor _ in range(t):\n    n, k = list(map(int, input().split()))\n    print(k+(k-1)//(n-1))\n", "passed": true, "time": 0.59, "memory": 14204.0, "status": "done"}, {"code": "for tc in range(int(input())):\n    n, k = [int(s) for s in input().split()]\n    k -= 1\n    print(k // (n-1) * n + k % (n-1) + 1)\n", "passed": true, "time": 0.14, "memory": 14180.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    n,k=map(int,input().split())\n    lo=0 \n    hi=10**20\n    def check(mi):\n        return mi-mi//n>=k \n    while lo<=hi:\n        mi=(lo+hi)//2 \n        if check(mi):\n            ans=mi \n            hi=mi-1 \n        else:\n            lo=mi+1 \n    print(ans)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "import math\nfor _ in range(int(input())):\n\tn,k=list(map(int,input().split()))\n\tl=k//(n-1)\n\tr=k%(n-1)\n\tif r==0:\n\t\tr=-1\n\tprint(l*n+r)\n\n\n\n\t\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}]