Logo
(追記) (追記ここまで)

26351번 - Cameron’s Crazy Circles 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB30161453.846%

문제

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

2
3 4
12 16

예제 출력 1

Case #1: 0.7171
Case #2: 0.7171

힌트

출처

University > University of Central Florida > 2011 Local Programming Contest 3번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /