题库练习 Marketing Scheme
← 上一题 下一题 →

A13966 | Marketing Scheme

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

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 $a$ cans in a pack with a discount and some customer wants to buy $x$ cans of cat food. Then he follows a greedy strategy:

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

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

But customers are greedy in general, so if the customer wants to buy $(x \bmod a)$ cans one by one and it happens that $(x \bmod a) \ge \frac{a}{2}$ he decides to buy the whole pack of $a$ cans (instead of buying $(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 $l$ to $r$ inclusive. Can you choose such size of pack $a$ that each customer buys more cans than they wanted initially?

输入格式

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

The first and only line of each test case contains two integers $l$ and $r$ ( $1 \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 $a$ 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
C++ 编辑器
输入
输出