1. import java.text.DecimalFormat;
import java.util.Scanner;


public class Main {

/**
* Angewandte Mathematik, SS11
* Problem: 11326 - Laser Pointer
* Link: http://uva.onlinejudge.org/external/113/11326.html
*
* @author Pirmin Schneider
* @version 1.0, 06/29/2011
*
* Method : Ad-Hoc
* Status : Accepted
* Runtime: 2.160
*
* Input: i (# testcases), L (length of the room), W (width of the room)
* Output: ratio A/B (A is the total indirect distance (through mirrors) and B the direct distance to exit)
*
*
* +---------------------+
* | /\ /\ |
* | / \ / \ |
* | / \ / \|
* | / \ / = W
* | / \ / |
* |/ theta \/ |
* +---------------------+
* L
*
*/

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);
StringBuffer buffer = new StringBuffer();
DecimalFormat f = new DecimalFormat("#0.000");

int testcases = sc.nextInt();

int theta; // angle for laser pointer

double A, B,
ratio,
L, W, // L: length of the room W: width of the room
c, d, // c: equilateral site of the triangle d: base of the equiliteral triangle
r, h, // r: rest distance to wall with exit h: distance of exit to the corner of the room
thetaRad, // theta as radians
thetaCos, // cosinus of theta
thetaSin, // sinus of theta
thetaTan, // tangens of theta
n; // how many hole triangles are there


for (int i=0; i<testcases; i++) {

L = sc.nextDouble();
W = sc.nextDouble();
theta = sc.nextInt();

// special cases: 0 and 90 .. avoids division by 0, like in line 83: c = W / sin(0) and is easy to "calculate"
if (theta == 90)

buffer.append(f.format(0.)+"\n");

else if (theta == 0) {

buffer.append(f.format(1.)+"\n");

}

else {

// convert to radians in order to be able to calculate with Math.sin() / Math.cos() / ...
thetaRad = Math.toRadians(theta);

thetaCos = Math.cos(thetaRad);
thetaSin = Math.sin(thetaRad);
thetaTan = Math.tan(thetaRad);

c = W / thetaSin;
d = c * thetaCos;

n = Math.floor(L/d);

/* if theta is sharp enough, the laserpointer reaches the wall without being mirrored,
* so A equals B (ratio 1) */
if (n<1) {

buffer.append(f.format(1.)+"\n");

} else {

// rest distance on base line to wall
r = L - n*d;

// inderect distance
A = n*c + r / thetaCos;

// the value of h depends on the number of times (even or odd) for the laser
// to reflect before reaching the exit
if(n%2 != 0)
h = W - thetaTan * r;
else
h = thetaTan * r;

// direct distance, Pythagoras
B = Math.sqrt(L*L + h*h);

ratio = A/B;

buffer.append(f.format(ratio)+"\n");
}

}

}

System.out.print(buffer);

}

}