#include <bits/stdc++.h>
using namespace std;
char buf[1 << 21], *p1 = buf, *p2 = buf;
__inline__ __attribute__((always_inline)) char getc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
int read() {
  register int res, f = 1;
  register char ch;
  while ((ch = getc()) > '9' || ch < '0') (ch == '-') && (f = -1);
  for (res = ch - '0'; (ch = getc()) >= '0' && ch <= '9';
       res = res * 10 + ch - '0')
    ;
  return res * f;
}
struct node {
  double x, y;
  __inline__ __attribute__((always_inline)) node() {}
  __inline__ __attribute__((always_inline))
  node(register double xx, register double yy)
      : x(xx), y(yy) {}
  __inline__ __attribute__((always_inline)) node operator+(
      const node &b) const {
    return node(x + b.x, y + b.y);
  }
  __inline__ __attribute__((always_inline)) node operator-(
      const node &b) const {
    return node(x - b.x, y - b.y);
  }
  __inline__ __attribute__((always_inline)) node operator*(
      const double &b) const {
    return node(x * b, y * b);
  }
  __inline__ __attribute__((always_inline)) double norm() {
    return sqrt(x * x + y * y);
  }
} p, pp, o;
int n, r1, r2;
double r, lx, rx, ir;
void get(register node o, register double k, register double b) {
  double del = ir / sqrt(k * k + 1);
  p = node(o.x - del, k * (o.x - del) + b),
  pp = node(o.x + del, k * (o.x + del) + b);
}
__inline__ __attribute__((always_inline)) node inv(register node p) {
  double len = 1.0 / p.norm();
  return p * (r * r * len * len);
}
int main() {
  for (int T = read(); T; --T) {
    r1 = read(), r2 = read(), n = read(), r = r2 * 0.5;
    lx = r * r / (r1 * 2), rx = r * r / (r2 * 2), ir = (rx - lx) * 0.5;
    o = node((lx + rx) * 0.5, 2 * n * ir);
    get(o, o.y / o.x, 0);
    printf("%.10lf\n", (inv(p) - inv(pp)).norm() * 0.5);
  }
  return 0;
}
