欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1980B.Choosing Cubes
Choosing Cubes
Dmitry has cubes, numbered from left to right from to . The cube with index is his favorite.
Dmitry threw all the cubes on the table, and the -th cube showed the value (). After that, he arranged the cubes in non-increasing order of their values, from largest to smallest. If two cubes show the same value, they can go in any order.
After sorting, Dmitry removed the first cubes. Then he became interested in whether he removed his favorite cube (note that its position could have changed after sorting).
For example, if , , (the favorite cube is highlighted in green), and , the following could have happened:
- After sorting , since the favorite cube ended up in the second position, it will be removed.
- After sorting , since the favorite cube ended up in the third position, it will not be removed.
Input
The first line contains an integer () — the number of test cases. Then follow the descriptions of the test cases.
The first line of each test case description contains three integers , , and () — the number of cubes, the index of Dmitry's favorite cube, and the number of removed cubes, respectively.
The second line of each test case description contains integers () — the values shown on the cubes.
Output
For each test case, output one line — "YES" if the cube will be removed in all cases, "NO" if it will not be removed in any case, "MAYBE" if it may be either removed or left.
You can output the answer in any case. For example, the strings "YES", "nO", "mAyBe" will be accepted as answers.
Samples
12
5 2 2
4 3 3 2 3
5 5 3
4 2 1 3 5
5 5 2
5 2 4 1 3
5 5 5
1 2 5 4 3
5 5 4
3 1 2 4 5
5 5 5
4 3 2 1 5
6 5 3
1 2 3 1 2 3
10 1 1
1 1 1 1 1 1 1 1 1 1
1 1 1
42
5 2 3
2 2 1 1 2
2 1 1
2 1
5 3 1
3 3 2 3 2
MAYBE
YES
NO
YES
YES
YES
MAYBE
MAYBE
YES
YES
YES
NO
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |