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

6926번 - Duathlon 다국어

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

문제

A duathlon is a race that involves running $r$ km and cycling $k$ km. $n$ contestants have entered the race; each contestant has different running and cycling speeds. One of the contestants has bribed the organizers to set $r$ and $k$ so that he can win by the maximum margin. You are to determine if this is possible and, if so, give $r$ and $k$.

입력

The first line of input contains an integer $t,ドル the total distance of the race, in km. That is, $r + k = t$. The next line contains an integer $n,ドル the number of competitors. For each contestant, a line follows with two real numbers giving the running and cycling speed for that contestant. The last line of input gives the running and cycling speed of the contestant who has bribed the organizers. You may assume $t$ does not exceed 100ドル$ km and $n$ does not exceed 20ドル$.

출력

If it is possible to fix the race as described above, print a message giving $r$ and $k,ドル and the amount by which the cheater will win the race, accurate to two decimal places as in the sample below. If it is not possible, print The cheater cannot win..

제한

예제 입력 1

100
3
10.0 40.0
20.0 30.0
15.0 35.0

예제 출력 1

The cheater can win by 612 seconds with r = 14.29km and k = 85.71km.

예제 입력 2

100
3
10.0 40.0
20.0 30.0
15.0 25.0

예제 출력 2

The cheater cannot win.

힌트

출처

Olympiad > Canadian Computing Competition & Olympiad > 2002 > CCO 2002 4번

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

출처

대학교 대회

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

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