407641: GYM102862 E Ice Cream

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Ice Creamtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

You are an ice cream man. You serve portions of ice cream filling a cone up to some level, and top it with two equally-sized flavored gelato balls. You are also generous, and want to put the largest balls you can. Both balls have to touch the main portion of the ice cream. The balls can touch, but not intersect. The balls can also touch, but not intersect the cone. What is the maximum possible radius of the ice cream balls?

Also, you live in 2D, so the cone is actually an isosceles triangle, and the balls are not spheres, but circles.

Given

  • the height of the cone $$$h$$$,
  • the level of the main ice cream portion inside the cone $$$\ell$$$,
  • the width of the cone top $$$w$$$,
calculate the maximum possible radius of the balls. Note that there can be different configurations.
Input

The first line of input contains an integer $$$t$$$, the number of test cases ($$$1 \leq t \leq 10^4$$$). Each of the next $$$t$$$ lines contains three integers $$$h$$$, $$$\ell$$$, $$$w$$$ ($$$1 \leq h, \ell, w \leq 10^9$$$, $$$h > \ell$$$), the description of a single test case.

Output

For each test case, output a single real number, the maximum possible radius of the two balls. The output must be within $$$10^{-6}$$$ absolute or relative error of the correct answer.

ExampleInput
1
10 8 8
Output
1.908131846

加入题单

上一题 下一题 算法标签: