Alice's Integer Roots
Bob has found a new way to keep Alice busy. He writes a huge number n on the board, names an exponent k, and asks: "What is the largest whole number which, multiplied by itself k times, still doesn't exceed my number?" Alice is quick, but Bob has prepared a long list of these questions, and some of his numbers sit just one away from a perfect power, which is exactly where guessing goes wrong.
Formally, for each query (n, k) find the largest positive integer x such that x^k ≤ n.
Input
The first line contains an integer t (1 ≤ t ≤ 10^5), the number of queries.
Each of the next t lines contains two integers n and k (1 ≤ n ≤ 10^18, 1 ≤ k ≤ 60).
Output
For each query, print on its own line the largest positive integer x with x^k ≤ n. Since n ≥ 1, the answer is always at least 1.
Notes
In the first example, 3^2 = 9 ≤ 10 but 4^2 = 16 > 10, so the answer is 3. The number 27 is exactly 3^3, so its answer is 3, while for 26 it drops to 2.
In the second example, 10^18 = (10^9)^2, and one less than that already has answer 999999999. The number 576460752303423488 equals 2^59.