QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#16515. Lone

统计

题目描述

她有一根长度为 $m$ 的木棍。

她希望你把这根木棍分成 $n$ 根小木棍,使得每一根小木棍的长度均为正整数,且从中任选 $3$ 根小木棍都可以通过首尾相连的方式组成一个三角形。

你想求出,你能否满足她的愿望。

输入格式

本题有多组测试数据。

输入的第一行包含一个正整数 $T$,表示测试数据组数。

接下来依次输入每组测试数据。对于每组测试数据,输入共一行,包含两个整数 $n,m$。

输出格式

对于每组测试数据,输出一行一个字符串:

  • 若你能满足她的愿望,则输出 Yes
  • 若你不能满足她的愿望,则输出 No

样例 1 输入

3
4 7
3 4
5 21

样例 1 输出

Yes
No
Yes

样例 1 解释

对于第 $1$ 组测试数据,可以把木棍分成长度分别为 $1,2,2,2$ 的小木棍。

对于第 $2$ 组测试数据,可以证明不存在满足要求的方案。

对于第 $3$ 组测试数据,其中一种满足要求的方案为把木棍分成长度分别为 $3,4,4,5,5$ 的小木棍。

数据范围

对于所有测试数据,保证:

  • $1 \le T \le 100$;
  • $3 \le n \le m \le 10^9$。

本题采用捆绑测试。

  • Subtask 1(18 points):$m \le 500$,$n=3$。
  • Subtask 2(15 points):$n=3$。
  • Subtask 3(32 points):$n\times 2 \ge m$。
  • Subtask 4(35 points):无特殊限制。

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.