#include <cmath>
#include <cstdio>
using namespace std;
int main()
{
const double pi = std::acos(-1);
int t, r, x;
scanf("%d", &t);
while (t--) {
scanf("%d%d", &r, &x);
double a = pi * x / 180;
printf("%.7lf\n", r*sin(a)/(sin(a)*sin(a)+cos(a)));
}
return 0;
}
I2luY2x1ZGUgPGNtYXRoPgojaW5jbHVkZSA8Y3N0ZGlvPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKCmludCBtYWluKCkKewoJY29uc3QgZG91YmxlIHBpID0gc3RkOjphY29zKC0xKTsKCWludCB0LCByLCB4OwoJc2NhbmYoIiVkIiwgJnQpOwoJd2hpbGUgKHQtLSkgewoJCXNjYW5mKCIlZCVkIiwgJnIsICZ4KTsKCQlkb3VibGUgYSA9IHBpICogeCAvIDE4MDsKCQlwcmludGYoIiUuN2xmXG4iLCByKnNpbihhKS8oc2luKGEpKnNpbihhKStjb3MoYSkpKTsKCX0KCXJldHVybiAwOwp9Cg==