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
2015-05-31 17:13:57 i_am_looser
Binary search that's it....AC ; )
2015-01-23 19:05:24 iitramar

for given test case..it works but i'm getting WA.plzz help
sol. id - 13502089


Last edit: 2015-01-23 19:06:26
2014-10-29 12:51:46 Vamsi Krishna Avula
I had to do 40 iterations in Newton's method, after choosing what I think is a optimal initial value of x.
2014-10-16 12:53:10 jinkies
pretty easy, can also solve by bisection method, choose the initial values to be 0 and 10^5... still AC in 0.03
2014-10-13 20:54:01 Md Abdul Alim
This is first time I used Newton Raphson Method. Learned Something New. Thanks Author :)
2014-09-26 19:49:46 Rahul Jain
Finally!! with 0.01s :)
2014-08-03 06:13:03 Anirudh
AC in 1st go ,used Newton-Raphson
2014-07-15 22:27:00 Arker
use n-r and some good initial approximation of x
2014-05-27 14:23:38 Pawan Namdev
6 iterations of newton raphson.... how do we guess no. of iterations???
2014-02-08 07:43:11 The Alchemist
newton raphson :D
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.