#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int SIZE = 1e6 + 10;
double sqr(double x) { return x * x; }
int main() {
  int ___T, case_n = 1;
  scanf("%d ", &___T);
  while (___T-- > 0) {
    int R, r, k;
    scanf("%d%d%d", &R, &r, &k);
    R *= 2;
    r *= 2;
    double D = 1. * R * R / r;
    double h = D - R;
    double w = h * k;
    double s = sqrt(sqr(R + h * 0.5) + sqr(w));
    printf("%.15f\n", 0.5 * (R * R / (s - h * 0.5) - R * R / (s + h * 0.5)));
  }
  return 0;
}
