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