#P11204. 「Cfz Round 9」Lone

「Cfz Round 9」Lone

Background

Click here (or at the bottom of this page) to download the English version of statements for this contest (PDF).

Problem Description

She has a wooden stick of length mm.

She wants you to cut this stick into nn smaller sticks, such that each smaller stick has a positive integer length, and any 33 of the smaller sticks you choose can form a triangle by connecting end to end.

You want to determine whether you can satisfy her wish.

Input Format

This problem contains multiple test cases.

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

Then follow the test cases. For each test case, there is one line containing two integers n,mn, m.

Output Format

For each test case, output one string per line:

  • If you can satisfy her wish, output Yes.
  • If you cannot, output No.
3
4 7
3 4
5 21
Yes
No
Yes

Hint

"Sample Explanation #1"

For the 11-st test case, you can cut the stick into smaller sticks with lengths 1,2,2,21, 2, 2, 2.

For the 22-nd test case, it can be proven that there is no solution that meets the requirements.

For the 33-rd test case, one feasible solution is to cut the stick into smaller sticks with lengths 3,4,4,5,53, 4, 4, 5, 5.

"Constraints"

For all testdata, it is guaranteed that:

  • 1T1001 \le T \le 100.
  • 3nm1093 \le n \le m \le 10^9.

This problem uses bundled tests.

  • Subtask 0 (18 points): m500m \le 500, n=3n = 3.
  • Subtask 1 (15 points): n=3n = 3.
  • Subtask 2 (32 points): n×2mn \times 2 \ge m.
  • Subtask 3 (35 points): No special constraints.

Translated by ChatGPT 5