CHI_ROOT - n-th root

Compute 101 significant figures of the n-th root of a number.

Input

The first line of the input contains the number of test cases. In each of the following lines, the numbers n and x are given, where n is a positive (32 bit) integer, and x is a floating point number with arbitrary precision.

Output

Each line of the output should be the sequence consisting of the first 101 digits of the positive n-th root of x. All trailing and leading zeroes, as well as the decimal point (if any) should be removed.

Score

For each test case, let K be the first position of the digit where the first difference to the reference solution occured. Then the score awarded to the test case will be K divided by the number of digits M in the reference solution. The numbers K and M are not larger than 101. For example, let us say we are computing the square root of 1.44, and the ouput is 11. Then since the reference solution is 12, this solution would receive the score of 0.5 (50%). The final score of the problem is the sum of the scores over all test cases, normalized so that the maximum possible score is 10.

Example

Input:
4
3 2
4 16
2 5
2 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679

Output:
12599210498948731647672106072782283505702514647015079800819751121552996765139594837293965624362550941
2
22360679774997896964091736687312762354406183596115257242708972454105209256378048994144144083787822749
17724538509055160272981674833411451827975494561223871282138077898529112845910321813749506567385446653

Added by:chi
Date:2016-02-20
Time limit:1s-1.5s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64 GOSU JS-MONKEY

hide comments
2019-12-31 06:43:49 MAYANK NARULA
my code is giving compilation error but running on ideone
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.