#include <bits/stdc++.h>
using namespace std;
int T;
double ans[300002];
int main() {
  scanf("%d", &T);
  while (T--) {
    double k1, k2, k3, r, R;
    int k;
    scanf("%lf%lf%d", &R, &r, &k);
    ans[0] = 1.0 / (R - r);
    k1 = -1.0 / R, k2 = 1.0 / r, k3 = 1.0 / (R - r);
    ans[1] = k1 + k2 + k3;
    k3 = ans[1];
    for (int i = 2; i <= k; i++)
      ans[i] = 2.0 * (k1 + k2 + k3) - ans[i - 2], k3 = ans[i];
    printf("%.10lf\n", 1.0 / ans[k]);
  }
}
