#include <bits/stdc++.h>
using namespace std;
using DB = double;
int main() {
  int ncase;
  for (scanf("%d", &ncase); ncase--;) {
    DB r, s;
    int k;
    scanf("%lf%lf%d", &r, &s, &k);
    DB a = 1.0 / s, b = 1.0 / r;
    DB c = (a + b) / 2, r0 = (a - b) / 2;
    DB h = r0 * k * 2;
    DB l = sqrt(h * h + c * c);
    printf("%.10lf\n", 1.0 / (l - r0) - 1.0 / (l + r0));
  }
  return 0;
}
