307928: CF1437A. Marketing Scheme
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Marketing Scheme
题意翻译
$\exists x$, 对于$\forall i \in [l,r]$,要求$i\ mod\ x \geq \frac{x}{2}$,判断是否存在这样的x题目描述
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