#include <bits/stdc++.h>
using namespace std;
template <class D>
inline void read(D &res) {
  res = 0;
  register D g = 1;
  register char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') g = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    res = (res << 3) + (res << 1) + (ch ^ 48);
    ch = getchar();
  }
  res *= g;
}
struct P {
  double x, y;
  P(double _x = 0.0, double _y = 0.0) {
    x = _x;
    y = _y;
  }
  friend P operator+(P a, P b) { return P(a.x + b.x, a.y + b.y); }
  friend P operator-(P a, P b) { return P(a.x - b.x, a.y - b.y); }
  friend P operator*(P a, double b) { return P(a.x * b, a.y * b); }
  inline double len() { return sqrt(x * x + y * y); }
} p, pp, o;
int T, n, r1, r2;
double r, lx, rx, ir;
inline void get(P o, double k, double b) {
  double del = ir / sqrt(k * k + 1);
  p = P(o.x - del, k * (o.x - del) + b);
  pp = P(o.x + del, k * (o.x + del) + b);
}
inline P inv(P x) {
  double invn = 1.0 / x.len();
  return x * (r * r * invn * invn);
}
int main() {
  read(T);
  while (T--) {
    read(r1);
    read(r2);
    read(n);
    r = r2 * 0.5;
    lx = r * r / (r1 * 2);
    rx = r * r / (r2 * 2);
    ir = (rx - lx) * 0.5;
    o = P((lx + rx) * 0.5, 2 * n * ir);
    get(o, o.y / o.x, 0);
    printf("%.10lf\n", (inv(p) - inv(pp)).len() * 0.5);
  }
  return 0;
}
