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