TLE '17 Contest 7 P3 - Countless Calculator Computations

View as PDF

Submit solution


Points: 7 (partial)
Time limit: 1.0s
Java 2.0s
Python 3.0s
Memory limit: 256M

Author:
Problem type
Leon is using a very powerful calculator.

Leon likes to play with calculators whenever he gets bored in class. Such fascinating devices! One day, an intriguing problem occurred to him:

If the equation XXX=Z contains Y number of X's, then given the values of Y and Z, what is the approximate value of X?

Leon is tasked with Q queries regarding this problem. Apparently, he didn't perform these countless calculator computations well enough.

Can you help him?

Input Specification

The first line contains integer Q (1Q20000), the number of queries.

The following Q lines each contain two space-separated integers Yi (2Yi100) and Zi (1Zi2311).

Output Specification

For each query, output the approximate value of Xi on its own line, accurate within an absolute error of 105.

For 50% of the points, Xi may be accurate within an absolute error of 101.

Sample Input

Copy
3
100 2
50 14
3 16

Sample Output

Copy
1.414213562
1.4484039
1.99999

Comments


  • 0
    tmago3  commented on Jan. 18, 2024, 6:51 a.m.

    how do we get the first answer