CF1437A.Marketing Scheme

普及/提高-

通过率:0%

AC君温馨提醒

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

题目描述

You got a job as a marketer in a pet shop, and your current task is to boost sales of cat food. One of the strategies is to sell cans of food in packs with discounts.

Suppose you decided to sell packs with aa cans in a pack with a discount and some customer wants to buy xx cans of cat food. Then he follows a greedy strategy:

  • he buys xa\left\lfloor \frac{x}{a} \right\rfloor packs with a discount;
  • then he wants to buy the remaining (xmoda)(x \bmod a) cans one by one.

xa\left\lfloor \frac{x}{a} \right\rfloor is xx divided by aa rounded down, xmodax \bmod a is the remainer of xx divided by aa .

But customers are greedy in general, so if the customer wants to buy (xmoda)(x \bmod a) cans one by one and it happens that (xmoda)a2(x \bmod a) \ge \frac{a}{2} he decides to buy the whole pack of aa cans (instead of buying (xmoda)(x \bmod a) cans). It makes you, as a marketer, happy since the customer bought more than he wanted initially.

You know that each of the customers that come to your shop can buy any number of cans from ll to rr inclusive. Can you choose such size of pack aa that each customer buys more cans than they wanted initially?

输入格式

The first line contains a single integer tt ( 1t10001 \le t \le 1000 ) — the number of test cases.

The first and only line of each test case contains two integers ll and rr ( 1lr1091 \le l \le r \le 10^9 ) — the range of the number of cans customers can buy.

输出格式

For each test case, print YES if you can choose such size of pack aa that each customer buys more cans than they wanted initially. Otherwise, print NO.

You can print each character in any case.

输入输出样例

  • 输入#1

    3
    3 4
    1 2
    120 150

    输出#1

    YES
    NO
    YES

说明/提示

In the first test case, you can take, for example, a=5a = 5 as the size of the pack. Then if a customer wants to buy 33 cans, he'll buy 55 instead ( 3mod5=33 \bmod 5 = 3 , 52=2.5\frac{5}{2} = 2.5 ). The one who wants 44 cans will also buy 55 cans.

In the second test case, there is no way to choose aa .

In the third test case, you can take, for example, a=80a = 80 .

首页