21307_无人照看的牛牛

2022-5-16 18:19| 发布者: Hocassian| 查看: 39| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505127950300-Problem List-采集的数据-后羿采集器.html

Pro.ID

21307

Title

无人照看的牛牛

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21307

AC

0

Submit

4

Ratio

0.00%

时间&空间限制

  • Time Limit: 1000/500 MS (Java/Others)     Memory Limit: 65536/32768 K (Java/Others)
  • 描述

    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
    2 1 1
    2 1 2
    2 1 3

    Sample Output

    3.14
    11.23
    27.13

    Source

    样例输入

    3
    2 1 1
    2 1 2
    2 1 3

    样例输出

    3.14
    11.23
    27.13

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部