P7593 "EZEC-8" Making Up Numbers
Description
Given the $n$ positive integers from $1$ to $n$, determine whether it is possible to choose exactly $k$ numbers such that the sum of the chosen numbers is $s$ (each number can be used at most once).
Input Format
**This problem contains multiple test cases.**
The first line contains a positive integer $T$, the number of test cases.
For each test case, one line contains three positive integers $n, k, s$.
Output Format
For each test case:
Output one line with a string, `Yes` or `No`, indicating whether it is possible to choose exactly $k$ numbers such that their sum is $s$.
Explanation/Hint
**This problem uses bundled testing.**
- Subtask 1 (15 points): $n \le 5$.
- Subtask 2 (15 points): $n \le 15$.
- Subtask 3 (20 points): $n \le 100$.
- Subtask 4 (15 points): $k = 1$.
- Subtask 5 (15 points): $s \le 15$.
- Subtask 6 (20 points): no special constraints.
For $100\%$ of the testdata, $1 \le T \le 10^3$, $1 \le k \le n \le 10^9$, $1 \le s \le 10^{18}$.
Translated by ChatGPT 5