306965: CF1279A. New Year Garland

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

New Year Garland

题意翻译

### 题意简述 给定 $r$ 个字符 R,$g$ 个字符 G,$b$ 个字符 B,问是否存在一种方案,使得所有字符排列组成的字符串不存在两个相邻且相同的字符。 ### 输入格式 **本题有多组数据**。 第一行一个正整数 $t(1\leq t \leq 100)$,表示数据组数。 对于每组数据,一行三个整数 $r,g,b(1\leq r,g,b \leq 10^9)$。 ### 输出格式 对于每组数据,如果方案存在,输出字符串 `Yes`。否则输出 `No`。 翻译贡献者 U108949

题目描述

Polycarp is sad — New Year is coming in few days but there is still no snow in his city. To bring himself New Year mood, he decided to decorate his house with some garlands. The local store introduced a new service this year, called "Build your own garland". So you can buy some red, green and blue lamps, provide them and the store workers will solder a single garland of them. The resulting garland will have all the lamps you provided put in a line. Moreover, no pair of lamps of the same color will be adjacent to each other in this garland! For example, if you provide $ 3 $ red, $ 3 $ green and $ 3 $ blue lamps, the resulting garland can look like this: "RGBRBGBGR" ("RGB" being the red, green and blue color, respectively). Note that it's ok to have lamps of the same color on the ends of the garland. However, if you provide, say, $ 1 $ red, $ 10 $ green and $ 2 $ blue lamps then the store workers won't be able to build any garland of them. Any garland consisting of these lamps will have at least one pair of lamps of the same color adjacent to each other. Note that the store workers should use all the lamps you provided. So Polycarp has bought some sets of lamps and now he wants to know if the store workers can build a garland from each of them.

输入输出格式

输入格式


The first line contains a single integer $ t $ ( $ 1 \le t \le 100 $ ) — the number of sets of lamps Polycarp has bought. Each of the next $ t $ lines contains three integers $ r $ , $ g $ and $ b $ ( $ 1 \le r, g, b \le 10^9 $ ) — the number of red, green and blue lamps in the set, respectively.

输出格式


Print $ t $ lines — for each set of lamps print "Yes" if the store workers can build a garland from them and "No" otherwise.

输入输出样例

输入样例 #1

3
3 3 3
1 10 2
2 1 1

输出样例 #1

Yes
No
Yes

说明

The first two sets are desribed in the statement. The third set produces garland "RBRG", for example.

Input

题意翻译

### 题意简述 给定 $r$ 个字符 R,$g$ 个字符 G,$b$ 个字符 B,问是否存在一种方案,使得所有字符排列组成的字符串不存在两个相邻且相同的字符。 ### 输入格式 **本题有多组数据**。 第一行一个正整数 $t(1\leq t \leq 100)$,表示数据组数。 对于每组数据,一行三个整数 $r,g,b(1\leq r,g,b \leq 10^9)$。 ### 输出格式 对于每组数据,如果方案存在,输出字符串 `Yes`。否则输出 `No`。 翻译贡献者 U108949

加入题单

算法标签: