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
i_am_looser: 2015-05-31 17:13:57

Binary search that's it....AC ; )

iitramar: 2015-01-23 19:05:24


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

Last edit: 2015-01-23 19:06:26
Vamsi Krishna Avula: 2014-10-29 12:51:46

I had to do 40 iterations in Newton's method, after choosing what I think is a optimal initial value of x.

jinkies: 2014-10-16 12:53:10

pretty easy, can also solve by bisection method, choose the initial values to be 0 and 10^5... still AC in 0.03

Md Abdul Alim: 2014-10-13 20:54:01

This is first time I used Newton Raphson Method. Learned Something New. Thanks Author :)

Rahul Jain: 2014-09-26 19:49:46

Finally!! with 0.01s :)

Anirudh: 2014-08-03 06:13:03

AC in 1st go ,used Newton-Raphson

Arker: 2014-07-15 22:27:00

use n-r and some good initial approximation of x

Pawan Namdev: 2014-05-27 14:23:38

6 iterations of newton raphson.... how do we guess no. of iterations???

The Alchemist: 2014-02-08 07:43:11

newton raphson :D


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