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

hide comments
marethyu1: 2019-03-04 20:53:43

Easy with bisection method!

cgiosy: 2018-06-01 03:44:32

Sample Input:
2
97084 82977 68488
27020 1897 56128
Sample Output:
0.384700
2.013848

prasoonbatham: 2017-05-26 06:16:39

Newton raphson with initial approximation of x = c/a;

Anuj Arora: 2016-08-04 22:55:05

Single shot AC ....both Bisection and Newton Raphson

Pratik Parwal: 2015-09-01 21:07:21

my 200th :)
learnt Newton Raphson :D

dwij28: 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 :)

Vikrant Singh: 2015-08-26 19:14:19

Got WAs due to fewer iterations :P

shantanu tripathi: 2015-08-11 08:24:21

can be done without newtons raphson.... bytlandian method is enough :)

Shrey: 2015-06-22 16:01:45

getting correct answer for many cases I checked. please check solution id 14512916.
@Saransh Bansal

[Mayank Pratap]: 2015-06-21 08:06:02

Nice problem to learn binary search ....especially for beginners like me... :)


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