#P7593. 「EZEC-8」凑数

「EZEC-8」凑数

Description

Given the nn positive integers from 11 to nn, determine whether it is possible to choose exactly kk numbers such that the sum of the chosen numbers is ss (each number can be used at most once).

Input Format

This problem contains multiple test cases.

The first line contains a positive integer TT, the number of test cases.

For each test case, one line contains three positive integers n,k,sn, 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 kk numbers such that their sum is ss.

3
5 2 10
5 2 5
5 2 2
No
Yes
No

Hint

This problem uses bundled testing.

  • Subtask 1 (15 points): n5n \le 5.
  • Subtask 2 (15 points): n15n \le 15.
  • Subtask 3 (20 points): n100n \le 100.
  • Subtask 4 (15 points): k=1k = 1.
  • Subtask 5 (15 points): s15s \le 15.
  • Subtask 6 (20 points): no special constraints.

For 100%100\% of the testdata, 1T1031 \le T \le 10^3, 1kn1091 \le k \le n \le 10^9, 1s10181 \le s \le 10^{18}.

Translated by ChatGPT 5