#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double EPS = 1e-9;
int T, n;
double R, r;
int main() {
  scanf("%d", &T);
  while (T--) {
    scanf("%lf%lf%d", &R, &r, &n);
    double h1 = R * R / 2 / r;
    double h2 = R / 2;
    double rr = (h1 - h2) / 2;
    double D = sqrt((h2 + rr) * (h2 + rr) + (2 * n * rr) * (2 * n * rr));
    printf("%.12f\n", R * R * (1.0 / (D - rr) - 1.0 / (D + rr)) / 2);
  }
  return 0;
}
