#include <bits/stdc++.h>
using namespace std;
int Q;
double R, r, A, B, ox, oy, oR, oK, ans;
int k;
int main() {
  scanf("%d", &Q);
  while (Q--) {
    scanf("%lf%lf%d", &R, &r, &k);
    A = 1.0 / (2 * R), B = 1.0 / (2 * r);
    ox = (A + B) / 2, oy = k * (B - A);
    oR = (B - A) / 2, oK = sqrt(ox * ox + oy * oy);
    ans = (1.0 / (oK - oR) - 1.0 / (oK + oR)) / 2;
    printf("%.8lf\n", ans);
  }
}
