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

14762번 - Election 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB121474250.602%

문제

After all the fundraising, campaigning and debating, the election day has finally arrived. Only two candidates remain on the ballot and you work as an aide to one of them.

Reports from the voting stations are starting to trickle in and you hope that you can soon declare a victory.

There are N voters and everyone votes for one of the two candidates (there are no spoiled ballots). In order to win, a candidate needs more than half of the votes. A certain number M ≤ N of ballots have been counted, and there are Vi votes for candidate i (V1+V2 = M), where V1 is the number of votes your candidate received.

Due to the historical data and results of highly scientific polls, you know that each of the remaining votes has a 50% chance to go to your candidate. That makes you think that you could announce the win before all the votes are counted. So, if the probability of winning strictly exceeds a certain threshold W, the victory is yours! We just hope you are sure of this, we don’t want any scandals...

입력

The first line of input contains a single positive integer T ≤ 100 indicating the number of test cases. Next T lines each contain four integers: N, V1, V2 and W as described above.

The input limits are as follows:

  • 1 ≤ N ≤ 50
  • 50 ≤ W < 100
  • V1, V2 ≥ 0
  • V1 + V2 ≤ N

출력

For each test case print a single line containing the appropriate action:

  • If the probability that your candidate will win is strictly greater than W%, print GET A CRATE OF CHAMPAGNE FROM THE BASEMENT!
  • If your candidate has no chance of winning, print RECOUNT!
  • Otherwise, print PATIENCE, EVERYONE!

제한

예제 입력 1

4
5 0 3 75
5 0 2 75
6 1 0 50
7 4 0 75

예제 출력 1

RECOUNT!
PATIENCE, EVERYONE!
PATIENCE, EVERYONE!
GET A CRATE OF CHAMPAGNE FROM THE BASEMENT!

힌트

출처

ICPC > Regionals > North America > Rocky Mountain Regional > 2016 Rocky Mountain Regional Contest B번

ICPC > Regionals > North America > South Central USA Regional > 2016 South Central USA Regional Programming Contest F번

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

출처

대학교 대회

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

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