#P5931. [清华集训 2015] 灯泡

    ID: 6264 远端评测题 1000ms 128MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>数学2015Special JudgeCTT(清华集训/北大集训)

[清华集训 2015] 灯泡

Background

In 20222022, the judging testdata changed a lot. Please ask anyone who passed this problem before 20222022 to submit again.

Problem Description

Compared with Wildleopard’s home, his younger brother Mildleopard is poorer. His house is narrow, and there is only one light bulb in his room. Every night, he walks around in his small house, thinking about how to earn more money. One day, he found that the length of his shadow changes as he walks between the light bulb and the wall. A sudden idea came to his mind: he wants to know the maximum possible length of his shadow in the room.

Input Format

The first line contains an integer TT, the number of test cases.

For each test case, there is one line containing three real numbers HH, hh, and DD. HH is the height of the light bulb, hh is Mildleopard’s height, and DD is the horizontal distance between the light bulb and the wall.

Output Format

Output TT lines. For each test case, output one line with the maximum shadow length LL. Your answer is accepted if the absolute error compared with the standard output is at most 10310^{-3}.

3
2 1 0.5
2 0.5 3
4 3 4
1.000
0.750
4.000

Hint

Constraints: 1T1001 \le T \le 100, 0.01H,h,D10000.01 \le H, h, D \le 1000, Hh0.01H - h \ge 0.01. It is guaranteed that HH, hh, and DD have at most 66 digits after the decimal point.

Translated by ChatGPT 5