Pro.ID21307 Title无人照看的牛牛 Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21307 AC0 Submit4 Ratio0.00% 时间&空间限制描述Farmer John has longed for his journey to San Antonio, not only to watch the Spurs playing against other NBA teams, but also to enjoy the ACM/ICPC world final. However, there is still a problem: he has a little cow in his farm, and if he leaves his farm for long, then the cow may starve to death. Fortunately, there is great grassland around Farmer John's farm house (the farm house can be viewed as a segment). So Farmer John has decided to tie the cow on a pole in front of the farm house, so that the cow will be able to move around the pole to eat grass when he is away. To simplify the situation, Farmer John will guarantee that the distance between the pole and each of the two endpoints of the farm house are the same. The figure below illustrates an example of the related positions of Farmer John's farm house and the pole: As Farmer John only finds a rope with limited length, he would like to know the area that the cow could eat grass, to make sure that the cow will keep alive during his journey. It's your task to write a program to help him. And please note that the cow can never pass through the area occupied by the farm house. 输入Input may contain several test cases. The first line is an integer, T (T ≤ 100), the number of test cases below. Each test case contains three positive integers: L, D, S, (L, D, S ≤ 10000), L is the length of the farm house segment (the length of segment E1E2 in the figure above), D is the distance between the pole and the center of the farm house (the distance between point Pole and point O in the figure above), and S is the length of the rope used to tie the cow. It's guaranteed that S will never exceed L plus the distance between the pole and the end point E1. 输出Description Farmer John has longed for his journey to San Antonio, not only to watch the Spurs playing against other NBA teams, but also to enjoy the ACM/ICPC world final. However, there is still a problem: he has a little cow in his farm, and if he leaves his farm for long, then the cow may starve to death. Fortunately, there is great grassland around Farmer John's farm house (the farm house can be viewed as a segment). So Farmer John has decided to tie the cow on a pole in front of the farm house, so that the cow will be able to move around the pole to eat grass when he is away. To simplify the situation, Farmer John will guarantee that the distance between the pole and each of the two endpoints of the farm house are the same. The figure below illustrates an example of the related positions of Farmer John's farm house and the pole: As Farmer John only finds a rope with limited length, he would like to know the area that the cow could eat grass, to make sure that the cow will keep alive during his journey. It's your task to write a program to help him. And please note that the cow can never pass through the area occupied by the farm house. Input Input may contain several test cases. The first line is an integer, T (T ≤ 100), the number of test cases below. Each test case contains three positive integers: L, D, S, (L, D, S ≤ 10000), L is the length of the farm house segment (the length of segment E1E2 in the figure above), D is the distance between the pole and the center of the farm house (the distance between point Pole and point O in the figure above), and S is the length of the rope used to tie the cow. It's guaranteed that S will never exceed L plus the distance between the pole and the end point E1. Output For each test case, output the area that the cow can reach to eat grass, round to 2 digits after the decimal point. Sample Input 3 Sample Output 3.14 Source 样例输入3 样例输出3.14 提示作者 |