#include <bits/stdc++.h>
using namespace std;
int n;
int R1, R2, R3;
double r1, r2, r3, r4, r5;
inline void work() {
  scanf("%d%d%d", &R1, &R2, &n);
  r1 = -1.0 / R1 + 1.0 / R2;
  r3 = 1.0 / (R1 - R2);
  r4 = r1 + r3;
  for (int i = 2; i <= n; ++i) {
    r5 = r3;
    r3 = r4;
    r4 = 2 * (r1 + r3) - r5;
  }
  printf("%.10lf\n", 1.0 / r4);
}
int main() {
  int T;
  cin >> T;
  while (T--) work();
  return 0;
}
