TRIGALGE - Easy Calculation

Find x such that Ax+Bsin(x)=C.

Input

The first line denotes T (number of test cases). 3T integers follow denoting A,B and C for every test case. (A >= B > 0). All Integers are less than 100000.

Output

T real numbers rounded to 6 digits one in each line.

Example

Input:
1
1 1 20

Output:
19.441787

Added by:Saransh Bansal
Date:2012-02-17
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2019-03-04 20:53:43
Easy with bisection method!
2018-06-01 03:44:32
Sample Input:
2
97084 82977 68488
27020 1897 56128
Sample Output:
0.384700
2.013848
2017-05-26 06:16:39
Newton raphson with initial approximation of x = c/a;
2016-08-04 22:55:05 Anuj Arora
Single shot AC ....both Bisection and Newton Raphson
2015-09-01 21:07:21 Pratik Parwal
my 200th :)
learnt Newton Raphson :D
2015-08-29 21:24:16
No clue how 6 iterations are working for some people, i tried 6 iterations by initialy guessing sinx to be 1 and also guessing sin x to be 0. Had 2 WA. Went for 50 iterations. AC it is .. Learnt Newton Raphson :)
2015-08-26 19:14:19 Vikrant Singh
Got WAs due to fewer iterations :P
2015-08-11 08:24:21 shantanu tripathi
can be done without newtons raphson.... bytlandian method is enough :)
2015-06-22 16:01:45 Shrey
getting correct answer for many cases I checked. please check solution id 14512916.
@Saransh Bansal
2015-06-21 08:06:02 [Mayank Pratap]
Nice problem to learn binary search ....especially for beginners like me... :)
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.