#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const double eps = 1e-15, pi = acos(-1);
inline long long rd() {
  long long x = 0, w = 1;
  char ch = 0;
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * w;
}
double r[5];
int k;
int main() {
  int T = rd();
  while (T--) {
    r[0] = rd(), r[1] = rd(), r[2] = r[0] - r[1], k = rd() - 1;
    r[0] = 1 / r[0], r[1] = 1 / r[1], r[2] = 1 / r[2];
    r[3] = r[2], r[2] = (r[1] + r[2] - r[0]);
    while (k--)
      r[4] = r[3], r[3] = r[2], r[2] = 2 * (r[1] + r[2] - r[0]) - r[4];
    printf("%.8lf\n", 1 / r[2]);
  }
  return 0;
}
