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
2012-03-21 01:22:25 Muhammad Yunus Bahari
AC :)

Last edit: 2012-03-21 02:54:27
2012-02-28 20:04:47 numerix


Last edit: 2012-04-05 09:42:42
2012-02-28 12:51:08 Devil D


Last edit: 2012-03-29 09:24:06
2012-03-31 10:19:39 Devil D
I took the initial guess as C/A.
2 iterations of Bisection and then Newton
got me AC 0.01s :)
2012-02-24 23:08:08 hemezh
What should be the initial guess?? I am using c/(a+b) and getting TLE.
2012-02-24 02:44:22 Peyman
Turns out you can do it much simpler than Newton; even in Python ;-)
2012-02-21 06:06:07 jitendra kumar
simple bisection gets AC just need to set range properly
2012-02-20 18:53:28 Ikhaduri
Bisection without Newton's will TLE?
2012-02-19 18:06:39 mehmetin
@surya
initial guess for newton's method
never mind submissions were rejudged and some of mine were accepted

Last edit: 2012-02-19 18:09:19
2012-02-19 18:02:35 Surya kiran
guess means ??
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.