#include <bits/stdc++.h>
void Get(int &T) {
  char C;
  bool F = 0;
  for (; C = getchar(), C < '0' || C > '9';)
    if (C == '-') F = 1;
  for (T = C - '0'; C = getchar(), C >= '0' && C <= '9'; T = T * 10 + C - '0')
    ;
  F && (T = -T);
}
int R, r, K;
void Init() {
  Get(R);
  Get(r);
  Get(K);
  K++;
}
double X1, X2, L;
void F(double &X, double &Y) {
  double Len2 = X * X + Y * Y;
  X = X1 * X1 * X / Len2;
  Y = X1 * X1 * Y / Len2;
}
double Dis2(double X1, double Y1, double X2, double Y2) {
  double DX = X2 - X1;
  double DY = Y2 - Y1;
  return DX * DX + DY * DY;
}
double Ans;
void Debug(double X, double Y) { printf("%lf %lf\n", X, Y); }
void Work() {
  X1 = R;
  X2 = X1 * X1 / r;
  L = X2 - X1;
  L *= 0.5;
  double XA = X1;
  double YA = L * (K + K - 2);
  double XB = X2;
  double YB = L * (K + K - 2);
  double XC = X1 + L;
  double YC = L * (K + K - 1);
  F(XA, YA);
  F(XB, YB);
  F(XC, YC);
  double BA = Dis2(XA, YA, XB, YB);
  double BC = Dis2(XC, YC, XB, YB);
  double CA = Dis2(XA, YA, XC, YC);
  double Cos2 = (BA + CA - BC) * (BA + CA - BC) / (4 * BA * CA);
  if (Cos2 > 1) Cos2 = 1;
  double Sin = sqrt(1 - Cos2);
  Ans = sqrt(BC) / Sin;
}
void Output() { printf("%.9lf\n", Ans); }
int main() {
  int Case;
  Get(Case);
  for (int i = 1; i <= Case; i++) {
    Init();
    Work();
    Output();
  }
  return 0;
}
