A manufacturing project consists of exactly $K$ tasks. The board overviewing the project wants to hire $K$ teams of workers — one for each task. All teams begin working simultaneously.
Obviously, there must be at least one person in each team. For a team of $A$ workers, it takes exactly $A$ days to complete the task they are hired for. Each team acts independently, unaware of the status of other teams (whether they have completed their tasks or not), and submits their result for approval on the $A$-th day.
However, the board approves the project only if all $K$ teams complete their tasks on the same day — it rejects everything submitted on any other day. The day after a team finds out that its result was rejected, it resumes work on the same task afresh. Therefore, as long as a team of $A$ workers keeps getting rejected, it submits a new result of their task for approval on the $A$-th, $2A$-th, $3A$-th day etc.
The board wants to hire workers in such a way that it takes exactly $X$ days to complete the project. Find the smallest number of workers it needs to hire.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains two space-separated integers $K$ and $X$.

-----Output-----
For each test case, print a single line containing one integer — the smallest required number of workers.

-----Constraints-----
- $1 \le T \le 40$
- $2 \le K, X \le 10^6$

-----Example Input-----
2
2 3
2 6

-----Example Output-----
4
5

-----Explanation-----
Example case 1: We can hire a team of $3$ workers for task $1$ and $1$ worker for task $2$. The one-man team working on task $2$ completes it and submits the result for approval on each day, but it is rejected on the first and second day. On the third day, the team working on task $1$ also completes their task, so the project gets approved after exactly $3$ days.
Example case 2: We can hire a team of $3$ workers for task $1$ and a team of $2$ workers for task $2$.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'import traceback;\nimport math;\n\nMAX_INF = 9223372036854775807\nINF = 2147483647\nSEM_INF = INF // 2\nMOD = int(1e9 + 7)\n\n\nclass HELPER:\n tmplst = []\n pntr = 0\n outPutStream = ""\n\n def __init__(self):\n  pass\n\n def __next__(self):\n  if self.pntr == -1 or self.pntr == len(self.tmplst):\n   self.tmplst = input().split(" ")\n   self.pntr = 0\n  ret = self.tmplst[self.pntr]\n  self.pntr += 1\n\n  return ret\n\n def nextInt(self):\n  return int(next(self))\n\n def nextFloat(self):\n  return float(next(self))\n\n def nextLine(self):\n  return input()\n\n def readArray(self, n):\n  l = []\n  for x in range(0, n):\n   l.append(self.nextInt())\n  return l\n\n def getIntArray(self, s):\n  l = []\n  s = s.split(" ")\n  for x in range(0, len(s)):\n   l.append(int(s[x]))\n\n  return l\n\n # Printing Arena\n\n def printArray(self, a, nextLine):\n  for x in a:\n   sc.write("{} ".format(x))\n  if nextLine:\n   self.writeln()\n\n def writeln(self, s):\n  self.outPutStream += (str(s) + "\\n")\n\n def write(self, s):\n  self.outPutStream += str(s)\n\n def flush(self):\n  print(self.outPutStream)\n  outPutStream = ""\n\n\nsc = HELPER()\n\n\ndef writeln(s=""):\n sc.writeln(s)\n\n\ndef write(s):\n sc.write(s)\n\n\n"""Code Starts Here"""\n\n\ndef getFactorList(n):\n l = [];\n p = 0\n while n % 2 == 0:\n  p += 1\n  n = n // 2\n l.append(int(math.pow(2,p)))\n\n x = 3\n while x <= math.sqrt(n):\n  p = 0\n  while n % x == 0:\n   n = n // x\n   p += 1\n  if p != 0:\n   l.append(int(math.pow(x,p)))\n  x += 2\n\n if n > 2:\n  l.append(n)\n\n return l\n\n\ndef getMinRecur(l, a, pos):\n if(pos == len(l)):\n  return sum(a)\n ans = float(\'inf\')\n for x in range(0,len(a)):\n  a[x] *= l[pos]\n  ans = min(ans,getMinRecur(l,a,pos + 1))\n  a[x] //= l[pos]\n\n return ans\n\n\ndef getMinAns(l,k):\n ans = 0\n if k == len(l):\n  ans = sum(l)\n elif k > len(l):\n  more = k - len(l)\n  ans = more + sum(l)\n else:\n  arr = [1] * k\n  ans = getMinRecur(l,arr,0)\n return ans\n\n\ndef testCase():\n k = sc.nextInt(); day = sc.nextInt()\n l = getFactorList(day)\n\n ans = getMinAns(l,k)\n ans = min(ans,day + k - 1)\n writeln(ans)\n pass\n\n\n"""Code Ends Here"""\n\n\ndef main():\n t = int(input())\n # t = 1\n while t > 0:\n  testCase()\n  t -= 1\n sc.flush()\n\n\ntry:\n def __starting_point():\n  main()\nexcept:\n print("Error Occured")\n traceback.print_exc()\n\n__starting_point()'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 227584