#include <bits/stdc++.h>
using namespace std;
void lemon() {
  double R1, R2;
  int k;
  scanf("%lf%lf%d", &R1, &R2, &k);
  k++;
  double xl = 1 / (R1 * 2), xr = 1 / (R2 * 2);
  double xc = (xl + xr) / 2, rad = abs(xc - xl);
  double yc = rad * (k - 1) * 2;
  double len = sqrt(xc * xc + yc * yc);
  double final = (1 / (len - rad) - 1 / (len + rad)) / 2;
  printf("%.16lf\n", final);
}
int main() {
  ios::sync_with_stdio(true);
  int tcase;
  scanf("%d", &tcase);
  while (tcase--) lemon();
  return 0;
}
