#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  double R1, R2;
  int T;
  scanf("%d", &T);
  while (T--) {
    scanf("%lf %lf", &R1, &R2);
    scanf("%I64d", &n);
    double ans = 0.0;
    double L = 1.0 / (2.0 * R1), R = 1.0 / (2.0 * R2);
    double r = (R - L) / 2.0, mid = (R + L) / 2.0;
    double res = sqrt(((R1 - R2) / (R1 - R2) - 1) * (1.0 / R1 / R2)) / 2.0;
    double x = (R + L) / 2.0, y = res + (R - L) * n;
    double ok = sqrt(x * x + y * y);
    ans = (1.0 / (ok - r) - 1.0 / (ok + r)) / 2.0;
    printf("%.8f\n", ans);
  }
  return 0;
}
