欢迎来到起遇信息学
起遇信息学正处于上线筹建阶段,以下功能已全部开放免费体验: ✅ 完整题库浏览与代码提交评测(C / C++ / Python / Java 等) ✅ 入门到进阶的系列课程试读、作业与考试 ✅ AI 提示、AI 作业分析等智能助教功能 ✅ 赛事模拟与个人能力报告 ✅ 邮箱注册开放 ⏳ 付费课程订阅与微信/支付宝支付通道 ⏳ 手机号登录,微信扫码登录、微信公众号绑定 使用中如遇任何问题,欢迎通过页面底部 **"联系我们"** 与我们沟通。
CF1878C.Vasilije in Cacak
Vasilije in Cacak
Aca and Milovan, two fellow competitive programmers, decided to give Vasilije a problem to test his skills.
Vasilije is given three positive integers: , , and , and he has to determine if he can choose distinct integers between and , such that their sum is equal to .
Since Vasilije is now in the weirdest city in Serbia where Aca and Milovan live, Cacak, the problem seems weird to him. So he needs your help with this problem.
Input
The first line contains a single integer () — the number of test cases.
The only line of each test case contains three integers , and (, , ) — the maximum element he can choose, the number of elements he can choose and the sum he has to reach.
Note that the sum of over all test cases may exceed .
Output
For each test case output one line: "YES", if it is possible to choose distinct integers between and , such that their sum is equal to , and "NO", if it isn't.
You can output the answer in any case (for example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as a positive answer).
Note
In the first test case , so we can choose the numbers: , , , whose sum is , so the answer is "YES".
In the second test case , there is no three numbers which satisfies the condition, so the answer is "NO". It can be shown that there are no three numbers whose sum is .
Samples
12
5 3 10
5 3 3
10 10 55
6 5 20
2 1 26
187856 87856 2609202300
200000 190000 19000000000
28 5 2004
2 2 2006
9 6 40
47202 32455 613407217
185977 145541 15770805980
YES
NO
YES
YES
NO
NO
YES
NO
NO
NO
YES
YES
在线编程 IDE
建议全屏模式获得最佳体验
| 进入全屏编程 | Alt+E |
| 递交评测 | Ctrl+Enter |
| 注释/取消注释 | Ctrl+/ |
| 缩放字体 | Ctrl+滚轮 |