#include <bits/stdc++.h>
using namespace std;
int n;
double R, r, k, f;
double dist(pair<double, double> a, pair<double, double> b) {
  return sqrt(((a.first - b.first) * (a.first - b.first)) +
              ((a.second - b.second) * (a.second - b.second)));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lf%lf%lf", &R, &r, &k);
    f = 4. * r * R;
    double _r = R - r;
    double y = (k + k) * _r;
    double x = R + r;
    double d = dist(make_pair(0, 0), make_pair(x, y));
    double ff = f / (2. * (d - _r));
    auto a = make_pair(x * ff / d, y * ff / d);
    double fff = f / (2. * (d + _r));
    auto b = make_pair(x * fff / d, y * fff / d);
    printf("%.10lf\n", dist(a, b));
  }
  return 0;
}
