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
StupidGuy: 2012-07-08 15:48:51

I am getting WA...Code works fine for given test case...Do i have to set precision?
Please someone post more test cases..

unXled: 2012-06-28 16:50:57

simple newton raphson with a optimal initial guess...got AC in 0.02 :)

suraj: 2012-05-14 10:19:46

@D: thanks for the reply. I was taking x as degree (not in radian) while calculating sin(x). now i got the question.

:D: 2012-05-14 06:24:36

I don't know what calculator your using, but that's a wrong value. Just run it on google.

suraj: 2012-05-13 21:00:07

with the 19.441787 + sin(19.441787)=19.774635955 not 20

:D: 2012-05-13 12:14:35

x is a scalar, so it's a radians value for sin.

19.441787 + sin(19.441787) = 20.0000005

suraj: 2012-05-13 12:02:13

with the 19.441787 + sin(19.441787)=19.774635955 not 20

Last edit: 2012-05-13 20:50:22
suraj: 2012-05-13 12:01:48

can any one ex[lain me the output,because
19.441787+sin (19.441787×3.14159÷180)=19.447709267, not equal to 20

Paras Sharma: 2012-05-07 13:11:14

directly newton raphson in 6 iteration is working :D AC in 0.01 sec.
just you need to take good initial guess.

Last edit: 2012-05-07 13:12:04
(Tjandra Satria Gunawan)(曾毅昆): 2012-04-08 16:00:56

regula falsi, AC 0.01s ;)


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