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

7108번 - Billiards 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB26131252.174%

문제

The sides of a right-angled field of size 47*73 centimeters are labeled using letters A,R,Z,D. A small ball B (its size can be ignored) is placed inside this field 13 centimeters away from the side R and 29 centimeters from the side D (see pic.3). A player places his cue on the side R at a point that is located k centimeters from the side D and straightly hits the ball B. The ball continues its movements in a straight line and, if necessary, hits the sides of the field. The deflection occurs according to the laws of physics, that is, in directions making equal angles with a line perpendicular to the reflecting side. The starting fragment of the movement of the ball is shown in pic.4.

Your task is to write a program that for the given integer numbers k(0 ≤ k ≤ 73) un n(0 ≤ n < 109) would output the distance of the ball to the side R(BR) and side D (BD) after the ball has moved exactly n centimeters. The values BR and BD must be output as real numbers rounded to the nearest one thousandth of a centimeter.

Pic. 3

Pic. 4

입력

출력

제한

예제 입력 1

29 100

예제 출력 1

19.000 29.000

예제 입력 2

16 20

예제 출력 2

27.142 43.142

힌트

출처

Olympiad > Latvian olympiad in informatics > 10th Latvian olympiad in informatics > Stage II (District/City) 3번

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

출처

대학교 대회

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

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