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
2013-12-25 19:06:17 Akash Jain
getting correct ans for the given test case..worked with newton and bisection separately..still wrong answer after running(4) :(
2013-09-21 10:13:31 Rajat Goyal
finally accepted in 0.01s
2013-07-02 11:15:06 Alien
Apply Raphson method. Take all values in double datatype
2013-06-24 23:31:02 NARUTO (y)
really thanx for comment and learn a lot by this problem .
use newton rapson method and try loop only 6 time u get answer

Last edit: 2013-06-24 23:32:05
2013-05-20 17:04:46 !!.Nginx.!!
Please help how to choose initial value...!!!

Got it Finally...my 50th submission. :)

Last edit: 2013-05-21 14:48:40
2013-03-14 09:07:22 Himanshu
@atul thanks dear....
take care of "NUMBER OF iterations" cause me many WA......
2013-03-13 17:47:50 Atul Kumar Verma
@himanshu newton raption works fine. you just need to make a good initial guess.
2013-03-11 05:10:17 Himanshu
TELL ME WHY IT GIVES tle
I M USING n-r METHOD???
2013-03-05 05:10:15 Bhagwat
Finally Accepted :)....Take care of initial value.
2013-02-12 19:17:07 gkg
@worldcreator i am doing x1=0.0
x2=1000.0
and x3=(x1+x2)/2 and loops run 100 times but i am getting ans 19.441787 ..explain plz
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.