#include <bits/stdc++.h>
int main() {
  double r1, r2, r3, l1, l2, m, x, y, la, lb, d;
  int t, k, i, j;
  scanf("%d", &t);
  for (i = 1; i <= t; i++) {
    scanf("%lf%lf%d", &r1, &r2, &k);
    l1 = r1 * 2;
    l2 = r1 * r1 * 2 / r2;
    m = (l1 + l2) / 2;
    r3 = l2 - m;
    x = r3 * 2 * k;
    y = m;
    la = sqrt(x * x + y * y) + r3;
    lb = sqrt(x * x + y * y) - r3;
    la = r1 * r1 * 4 / la;
    lb = r1 * r1 * 4 / lb;
    d = (lb - la) / 2;
    printf("%.10f\n", d);
  }
  return 0;
}
