아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Cameron’s Crazy Circles

시간 제한1초메모리 제한1024 MB

요약
직각삼각형의 두 변 길이가 주어질 때, 긴 변을 따라 무한히 내접하는 원들의 넓이 합과 삼각형 넓이의 비를 각 테스트 케이스마다 소수점 네 자리로 반올림해 구한다.
난이도

보통10점 중 6점

유형
기하, 수학, 조합론, 구현
정답자
아직 제출이 없습니다

문제

Your cousin Cameron loves circles and has created a rather tantalizing geometry problem, involving an infinite number of circles. He also loves triangles, but he loves circles even more. His problem starts with inscribing a circle in a right triangle as shown below:

Most circle and triangle lovers would stop here, but Cameron is curious what happens if you inscribe a second circle in between the longer leg of the triangle, the hypotenuse and the previous circle (without circles overlapping each other):

In fact, it turns out that you could continue this process an infinitum, inscribing a new circle in between the longer leg, the hypotenuse and the previous circle.

Given the lengths of the two legs of the right triangle, determine the ratio of the area of all the (infinite number of) circles along the longer leg to the area of the original right triangle.

입력

The first input line contains a single positive integer, n, indicating the number of triangles to solve. Each of the following n input lines will contain one test case. Each input case will be two positive integers, L1 and L2, separated by spaces, where L1 < L2 < 10000; these are the two legs of a right triangle.

출력

For each test case, first output “Case #i:” where i is the test case number, starting with 1. Then, output the correct ratio for the case, printed to 4 decimal places, rounded to the nearest tenthousandth (e.g., 0.00113 should round to 0.0011, 0.00115 should round to 0.0012, and 0.00117 should round to 0.0012). Answers will be judged as correct if they are within 0.0001 of the judge’s answer.

Leave a blank line after the output for each test case. Follow the format illustrated in Sample Output.

예제1

  1. 예제 1

    입력
    2
    3 4
    12 16
    
    예상 출력
    Case #1: 0.7171
    
    Case #2: 0.7171