#include <bits/stdc++.h>
using namespace std;
int nq, k;
double ans;
int main() {
  int i, j, q;
  double r0, r1, r2, rn, x, y;
  scanf("%d", &nq);
  for (q = 1; q <= nq; q++) {
    scanf("%lf%lf%d", &r0, &r1, &k);
    x = (2 * r0) * (2 * r0) / (2 * r1);
    rn = (x - r0 * 2) / 2;
    x = (x + r0 * 2) / 2;
    y = rn * k * 2;
    ans = (1 / (sqrt(x * x + y * y) - rn) - 1 / (sqrt(x * x + y * y) + rn)) *
          (r0 * 2) * (r0 * 2) / 2;
    printf("%.10lf\n", ans);
  }
  return 0;
}
