#include <bits/stdc++.h>
using namespace std;
namespace Sakurajima_Mai {
const int infi = 2e9;
const long long infl = 4e18;
inline int qi() {
  int f = 0, fu = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') fu = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    f = (f << 3) + (f << 1) + c - 48;
    c = getchar();
  }
  return f * fu;
}
inline long long ql() {
  long long f = 0;
  int fu = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') fu = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    f = (f << 3) + (f << 1) + c - 48;
    c = getchar();
  }
  return f * fu;
}
inline long long ceil_div(long long a, long long b) { return (a + b - 1) / b; }
}  // namespace Sakurajima_Mai
using namespace Sakurajima_Mai;
const double pi = acos(-1.0);
const double eps = 1e-6;
inline int sgn(double x) { return fabs(x) < eps ? 0 : (x < 0 ? -1 : 1); }
struct Point {
  double x, y;
  Point() {}
  Point(double _x, double _y) { x = _x, y = _y; }
  void input() { scanf("%lf", &x), scanf("%lf", &y); }
  bool operator==(Point b) const {
    return sgn(x - b.x) == 0 && sgn(y - b.y) == 0;
  }
  Point operator+(const Point &b) const { return Point(x + b.x, y + b.y); }
  Point operator-(const Point &b) const { return Point(x - b.x, y - b.y); }
  Point operator/(const double b) const { return Point(x / b, y / b); }
  Point operator*(const double b) const { return Point(x * b, y * b); }
  double operator^(const Point &b) const { return x * b.y - y * b.x; }
  double operator*(const Point &b) const { return x * b.x + y * b.y; }
  double dis(Point p) {
    return sqrt((x - p.x) * (x - p.x) + (y - p.y) * (y - p.y));
  }
};
struct Circle {
  Point o;
  double r;
  Circle() {}
  Circle(Point _o, double _r) { o = _o, r = _r; }
};
inline double sqr(double x) { return x * x; }
inline double dist(Point a, Point b) {
  return sqrt(sqr(a.x - b.x) + sqr(a.y - b.y));
}
double Inversion_CtoC(Point O, double R, Circle A) {
  double OA = A.o.dis(O);
  return (A.r / (OA * OA - A.r * A.r)) * R * R;
}
int main() {
  double R = 20;
  Point O(0, 0);
  int T = qi();
  while (T--) {
    double r1, r2;
    scanf("%lf", &r1), scanf("%lf", &r2);
    int k = qi();
    double lx = R * R / (2 * r1), rx = R * R / (2 * r2);
    Circle now(Point((lx + rx) / 2, 0), (rx - lx) / 2);
    double nowr = (r1 - r2);
    for (register int i = 1, bbb = k; i <= bbb; ++i) {
      now.o.y += (rx - lx);
      nowr = Inversion_CtoC(O, R, now);
      if (sgn(nowr - eps) < 0) break;
    }
    printf("%.8f\n", nowr);
  }
  return 0;
}
