For a rational number a = p / q with a > 0, find the largest constant C such that
e^x >= C * x^a for all x > 0.
The first line contains the integer T. Each of the next T lines contains the integers p and q describing one query.
T lines, the constant C for each query in order. Answers within absolute or relative error 10^-9 are accepted.
1 <= T <= 10^4
1 <= p, q <= 10^6
0 < p / q <= 100
This is a standard problem: a submission scores full points if it produces the correct output for every test case, and zero otherwise.
Numeric answers are accepted if they are within an absolute tolerance of 1e-09 or a relative tolerance of 1e-09 of the expected value.
3 1 1 2 1 1 2
2.718281828459045 1.8472640247326626 2.331643981597124
3 100 1 4 2 271828 100000
2.6881171418161354e-157 1.8472640247326626 1.000001828460102