#include <bits/stdc++.h>
using namespace std;
int n, T;
int main() {
  for (cin >> T; T--;) {
    double r1, r2, r3, r4, las;
    int k;
    scanf("%lf%lf%d", &r1, &r2, &k);
    r3 = r1 - r2;
    r1 = -1.0 / r1, r2 = 1.0 / r2, r3 = 1.0 / r3;
    for (int i = 1; i <= k; ++i) {
      double b = 2 * (r1 + r2 + r3);
      if (i == 1)
        r4 = b / 2;
      else
        r4 = b - las;
      las = r3;
      r3 = r4;
    }
    printf("%.10lf\n", 1.0 / r3);
  }
  return 0;
}
