CF1594F.Ideal Farm

提高+/省选-

通过率:0%

时间限制:2.00s

内存限制:256MB

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Theofanis decided to visit his uncle's farm. There are ss animals and nn animal pens on the farm. For utility purpose, animal pens are constructed in one row.

Uncle told Theofanis that a farm is lucky if you can distribute all animals in all pens in such a way that there are no empty pens and there is at least one continuous segment of pens that has exactly kk animals in total.

Moreover, a farm is ideal if it's lucky for any distribution without empty pens.

Neither Theofanis nor his uncle knows if their farm is ideal or not. Can you help them to figure it out?

西奥法尼斯决定去拜访他叔叔的农场。农场里共有 ss 只动物和 nn 个畜栏。出于实用目的,这些畜栏被建造成一排。

叔叔告诉西奥法尼斯:若能将所有动物分配到全部畜栏中,使得没有空畜栏,且存在至少一个连续的畜栏段,其内动物总数恰好为 kk,则该农场被称为“幸运的”。

此外,若对于所有不产生空畜栏的分配方式,该农场都是幸运的,则称该农场是“理想的”。

西奥法尼斯和他的叔叔都不知道他们的农场是否理想。你能帮他们判断吗?

输入格式

The first line contains a single integer tt (1≤t≤1051 \le t \le 10^5) — the number of test cases.

The first and only line of each test case contains three integers ss, nn, and kk (1≤s,n,k≤10181 \le s, n, k \le 10^{18}; n≤sn \le s).

第一行包含一个整数 tt(1≤t≤1051 \le t \le 10^5)—— 表示测试用例的数量。

每个测试用例仅有一行,包含三个整数 ss、nn 和 kk(1≤s,n,k≤10181 \le s, n, k \le 10^{18};且 n≤sn \le s)。

输出格式

For each test case, print YES (case-insensitive), if the farm is ideal, or NO (case-insensitive) otherwise.

对于每个测试用例,如果农场是理想的,则输出 YES(不区分大小写);否则输出 NO(不区分大小写)。

输入输出样例

  • 输入#1

    4
    1 1 1
    1 1 2
    100 50 200
    56220 47258 14497

    输出#1

    YES
    NO
    NO
    YES

说明/提示

For the first and the second test case, the only possible combination is [1][1] so there always will be a subsegment with 11 animal but not with 22 animals.

对于第一个和第二个测试用例,唯一可能的组合是 [1][1],因此总是存在一个包含 11 只动物的子段,但不存在包含 22 只动物的子段。

输入解题思路,AI测评打分。不知道怎么写?

首页