#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:16000000")
#pragma warning(disable : 4996)
const int inf = 2111111111;
const double eps = 1e-9;
int main() {
  int tt;
  cin >> tt;
  while (tt--) {
    double R, r;
    cin >> R >> r;
    int k;
    cin >> k;
    double x1 = 0.5 / R, x2 = 0.5 / r;
    double d = x2 - x1;
    double r0 = sqrt(((d / 2 + x1) * (d / 2 + x1)) + ((d * k) * (d * k)));
    double r1 = r0 - d / 2, r2 = r0 + d / 2;
    printf("%.9lf\n", (1 / r1 - 1 / r2) * 0.5);
  }
  return 0;
}
