QOJ.ac

QOJ

时间限制: 1.0 s 内存限制: 2048 MB 总分: 100

#15939. 选举

统计

Image by democratic alliance cc by-sa 2.0

在经历了所有的资金筹集、竞选活动和辩论之后,选举日终于到来了。选票上只剩下两位候选人,而你作为其中一位候选人的助手工作。

来自投票站的报告开始陆续传来,你希望很快就能宣布胜利。

共有 $N$ 名选民,每个人都投票给两位候选人之一(没有废票)。为了获胜,候选人需要获得超过半数的选票。目前已经统计了特定数量 $M \le N$ 的选票,候选人 $i$ 获得了 $V_i$ 张选票($V_1 + V_2 = M$),其中 $V_1$ 是你的候选人获得的选票数。

根据历史数据和高度科学的民意调查结果,你得知剩余的每张选票有 $50\%$ 的概率投给你的候选人。这让你觉得你可以在所有选票统计完毕之前宣布获胜。因此,如果获胜的概率严格大于某个阈值 $W$,那么胜利就是你们的了!

我们只希望你对此确信无疑,我们可不想闹出任何丑闻……

输入格式

输入的第一行包含一个正整数 $T \le 100$,表示测试用例的数量。接下来的 $T$ 行,每行包含四个整数:$N$,$V_1$,$V_2$ 和 $W$,如上所述。

输入限制如下:

  • $1 \le N \le 50$
  • $50 \le W < 100$
  • $V_1, V_2 \ge 0$
  • $V_1 + V_2 \le N$

输出格式

对于每个测试用例,输出一行,包含相应的行动:

  • 如果你的候选人获胜的概率严格大于 $W\%$,输出 GET A CRATE OF CHAMPAGNE FROM THE BASEMENT!
  • 如果你的候选人没有获胜的机会,输出 RECOUNT!
  • 否则,输出 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!

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.