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
Akash Jain: 2013-12-25 19:06:17

getting correct ans for the given test case..worked with newton and bisection separately..still wrong answer after running(4) :(

Rajat Goyal: 2013-09-21 10:13:31

finally accepted in 0.01s

Alien: 2013-07-02 11:15:06

Apply Raphson method. Take all values in double datatype

NARUTO (y): 2013-06-24 23:31:02

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
!!.Nginx.!!: 2013-05-20 17:04:46

Please help how to choose initial value...!!!

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

Last edit: 2013-05-21 14:48:40
Himanshu: 2013-03-14 09:07:22

@atul thanks dear....
take care of "NUMBER OF iterations" cause me many WA......

Atul Kumar Verma: 2013-03-13 17:47:50

@himanshu newton raption works fine. you just need to make a good initial guess.

Himanshu: 2013-03-11 05:10:17

TELL ME WHY IT GIVES tle
I M USING n-r METHOD???

Bhagwat: 2013-03-05 05:10:15

Finally Accepted :)....Take care of initial value.

gkg: 2013-02-12 19:17:07

@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


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