Gru wants to distribute $N$ bananas to $K$ minions on his birthday.
Gru does not like to just give everyone the same number of bananas, so instead, he wants to distribute bananas in such a way that each minion gets a $distinct$ amount of bananas. That is, no two minions should get the same number of bananas.
Gru also loves $gcd$. The higher the $gcd$, the happier Gru and the minions get. So help Gru in distributing the bananas in such a way that each Minion gets a distinct amount of bananas and gcd of this distribution is highest possible. Output this maximum gcd. If such a distribution is not possible output $-1$.
Note: You have to distribute $all$ $N$ bananas. 

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- Each testcase consists of a single line of input, which has two integers: $N, K$. 

-----Output:-----
For each testcase, output in a single line the maximum gcd or -1.

-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq N, K \leq 10^9$

-----Sample Input:-----
1
6 3

-----Sample Output:-----
1

-----EXPLANATION:-----
The only possible distribution is $[1, 2, 3]$. So the answer is 1.

```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 math\nfor _ in range(int(input())):\n lis=list(map(int,input().split()))\n n=lis[0]\n k=lis[1]\n temp=k*(k+1)//2\n if n<temp:\n  print(-1)\n else:\n  if k==1:\n   print(n)\n  else:\n   flag=1\n   for i in range(2,int(n**0.5)+1):\n    if (n % i == 0):\n     if(n//i>=temp):\n      flag=max(flag,i)\n     k=n//i\n     if(n//k>=temp):\n      flag=max(flag,k)\n   print(flag)\n\'\'\'\nfor _ in range(int(input())):\n    n=int(input())\n    lis=list(map(int,input().split()))\n    q=int(input())\n    s=\'\'\n    for i in range(n):\n     if (lis[i]&1)==0:\n      s+=\'0\'\n     else:\n      s+=\'1\'\n    for _ in range(q):\n     x=list(map(int,input().split()))\n     l=x[0]\n     r=x[1]\n     temp=\'1\'*((r+1)-l)\n     if temp==s[l-1:r]:\n      print("ODD")\n     else:\n      print("EVEN")\n\'\'\'\n\n\'\'\'\nn=int(input())\nlis=list(map(int,input().split()))\nm=lis[0]\nc=lis[1]\nc1=0\nc2=0\nfor i in range(n):\n    temp=0\n    t=list(map(int,input().split()))\n    temp=t[1]-m*t[0]-c\n    if temp>0:\n     c1+=t[2]\n    else:\n     c2+=t[2]\nprint(max(c1,c2))\n\'\'\'\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13229