#include using namespace std; int t, d, x, y, i, xx, yy, a, b; int main() { cin >> t; while (t--) { i = 1; cin >> d >> x >> y; a = x * x + y * y; xx = x; yy = y; while (xx - i * y >= 0 && yy + i * x <= d) i++; i--; b = (x - (xx - i * y)) * (x - (xx - i * y)); b += (yy + i * x - y) * (yy + i * x - y); cout << sqrt(a*b) << '\n'; } }