#P15142. [SWERC 2025] Hyper Smawk Bros

[SWERC 2025] Hyper Smawk Bros

题目描述

You and Bob are playing Hyper Smawk Bros against each other, facing a single boss with health nn. You and Bob act alternately, and you start. On your turn, you may use an attack that deals an integer amount of damage xx in [1,m][1, m], replacing nn with nxn - x. However, you cannot use the same xx that your opponent just used on the previous turn (on the very first move of the game, any xx in [1,m][1, m] is allowed).

The winner is the first player to reduce the boss’s health to n0n \le 0. Determine whether you can force a win if Bob plays optimally.

输入格式

Each test contains multiple test cases. The first line contains the number of test cases tt (1t1041 \le t \le 10^4). The description of the test cases follows.

The only line of each test case contains two integers n,mn, m (1n1061 \le n \le 10^6, 2m1062 \le m \le 10^6) — the starting health nn and the maximum damage per attack mm.

Note that there are no constraints on the sum of nn over all test cases, and there are no constraints on the sum of mm over all test cases.

输出格式

For each test case, output YES if you can force a win against Bob, and NO otherwise.

The judge is case-insensitive (for example, YES, Yes, yes, yEs will all be recognized as positive answers).

8
6 9
20 10
69 2
42 9
42 10
44 9
44 10
400000 400000
YES
YES
NO
NO
YES
YES
NO
YES

提示

Explanation of sample 1.

In the first test case, you can win immediately by dealing damage 88, so that nn becomes 68=206 - 8 = -2 \le 0.

In the second test case,

  • you choose to deal damage 1010;
  • Bob can choose to deal any damage in [1,10][1, 10] different from 1010;
  • then you can choose to deal damage 1010 and win.

In the third test case,

  • either you start by dealing damage 11, then Bob must deal damage 22, then you must deal damage 11, etc.;
  • or you start by dealing damage 22, then Bob must deal damage 11, then you must deal damage 22, etc.

In both cases, you lose.