308434: CF1519A. Red and Blue Beans
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Red and Blue Beans
题意翻译
给定 $r$ 个红色的豆子,$b$ 个蓝色的豆子,现将它们放入若干个袋子里。要求: - 每个袋子里至少有$1$颗红豆 $(r_i \geqslant 1)$ - 每个袋子里至少有$1$颗蓝豆 $(b_i \geqslant 1)$ - 每个袋子中的两色豆子之差小于等于$d$ $(|r_i - b_i|\leqslant d)$题目描述
You have $ r $ red and $ b $ blue beans. You'd like to distribute them among several (maybe, one) packets in such a way that each packet: - has at least one red bean (or the number of red beans $ r_i \ge 1 $ ); - has at least one blue bean (or the number of blue beans $ b_i \ge 1 $ ); - the number of red and blue beans should differ in no more than $ d $ (or $ |r_i - b_i| \le d $ ) Can you distribute all beans?输入输出格式
输入格式
The first line contains the single integer $ t $ ( $ 1 \le t \le 1000 $ ) — the number of test cases. The first and only line of each test case contains three integers $ r $ , $ b $ , and $ d $ ( $ 1 \le r, b \le 10^9 $ ; $ 0 \le d \le 10^9 $ ) — the number of red and blue beans and the maximum absolute difference in each packet.
输出格式
For each test case, if you can distribute all beans, print YES. Otherwise, print NO. You may print every letter in any case you want (so, for example, the strings yEs, yes, Yes and YES are all recognized as positive answer).
输入输出样例
输入样例 #1
4
1 1 0
2 7 3
6 1 4
5 4 0
输出样例 #1
YES
YES
NO
NO