CF397B.On Corruption and Numbers
普及/提高-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
Alexey, a merry Berland entrant, got sick of the gray reality and he zealously wants to go to university. There are a lot of universities nowadays, so Alexey is getting lost in the diversity — he has not yet decided what profession he wants to get. At school, he had bad grades in all subjects, and it's only thanks to wealthy parents that he was able to obtain the graduation certificate.
The situation is complicated by the fact that each high education institution has the determined amount of voluntary donations, paid by the new students for admission — n__i berubleys. He cannot pay more than n__i, because then the difference between the paid amount and n__i can be regarded as a bribe!
Each rector is wearing the distinctive uniform of his university. Therefore, the uniform's pockets cannot contain coins of denomination more than r__i. The rector also does not carry coins of denomination less than l__i in his pocket — because if everyone pays him with so small coins, they gather a lot of weight and the pocket tears. Therefore, a donation can be paid only by coins of denomination x berubleys, where l__i ≤ x ≤ r__i (Berland uses coins of any positive integer denomination). Alexey can use the coins of different denominations and he can use the coins of the same denomination any number of times. When Alexey was first confronted with such orders, he was puzzled because it turned out that not all universities can accept him! Alexey is very afraid of going into the army (even though he had long wanted to get the green uniform, but his dad says that the army bullies will beat his son and he cannot pay to ensure the boy's safety). So, Alexey wants to know for sure which universities he can enter so that he could quickly choose his alma mater.
Thanks to the parents, Alexey is not limited in money and we can assume that he has an unlimited number of coins of each type.
In other words, you are given t requests, each of them contains numbers n__i, l__i, r__i. For each query you need to answer, whether it is possible to gather the sum of exactly n__i berubleys using only coins with an integer denomination from l__i to r__i berubleys. You can use coins of different denominations. Coins of each denomination can be used any number of times.
亚历克斯,一位快乐的贝尔兰德大学考生,厌倦了灰暗的现实,热切地渴望进入大学。如今大学数量众多,亚历克斯在纷繁的选择中迷失了方向——他尚未决定自己想从事何种专业。他在中学各科成绩都很差,仅凭富裕的父母才得以获得毕业证书。
情况因以下事实而变得复杂:每所高等教育机构都规定了新生入学时需自愿捐赠的金额——即 ni 贝鲁布雷(berubleys)。他不能支付超过 ni 的金额,因为超出部分可能被视为贿赂!
每位校长都穿着其所在大学特有的制服,因此制服口袋所能容纳的硬币面额上限为 ri;同时,校长口袋中也不携带面额小于 li 的硬币——因为若人人都用如此小面额的硬币付款,硬币总重量过大,会导致口袋撕裂。因此,捐赠款只能由面额为 x 贝鲁布雷的硬币支付,其中 li≤x≤ri(贝尔兰德使用任意正整数面额的硬币)。亚历克斯可使用不同面额的硬币,且每种面额的硬币可使用任意多次。当亚历克斯初次面对这些规定时,他感到困惑,因为他发现并非所有大学都能接受他!亚历克斯非常害怕参军(尽管他早就渴望穿上绿色军装,但他的父亲说军队里的老兵会欺负他儿子,而他无法花钱来确保儿子的安全)。因此,亚历克斯迫切地想要确切知道哪些大学他能够进入,以便能迅速选定自己的母校。
得益于父母的支持,亚历克斯在资金上不受限制,我们可以假设他拥有每种面额的硬币无限多枚。
换言之,你将收到 t 个查询,每个查询包含三个数 ni、li、ri。对每个查询,你需要判断:是否能恰好凑出总和为 ni 贝鲁布雷的金额,且所用硬币的面额均为介于 li 到 ri(含端点)之间的整数。你可以使用不同面额的硬币,且每种面额的硬币可使用任意多次。
输入格式
The first line contains the number of universities t, (1 ≤ t ≤ 1000) Each of the next t lines contain three space-separated integers: n__i, l__i, r__i (1 ≤ n__i, l__i, r__i ≤ 109; l__i ≤ r__i).
第一行包含大学的数量 t(1 ≤ t ≤ 1000)。接下来的 t 行中,每行包含三个以空格分隔的整数:ni、li、ri(1 ≤ ni, li, ri ≤ 109;li ≤ ri)。
输出格式
For each query print on a single line: either "Yes", if Alexey can enter the university, or "No" otherwise.
对于每个查询,在一行中输出:如果 Alexey 能够进入该大学,则输出“Yes”;否则输出“No”。
输入输出样例
输入#1
2 5 2 3 6 4 5
输出#1
Yes No
说明/提示
You can pay the donation to the first university with two coins: one of denomination 2 and one of denomination 3 berubleys. The donation to the second university cannot be paid.
你可以用两枚硬币向第一所大学捐款:一枚面值为 2 伯鲁比尔,一枚面值为 3 伯鲁比尔。无法向第二所大学捐款。
输入解题思路,AI测评打分。不知道怎么写?