A. New Year Garland

time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

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 33 red, 33 green and 33 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, 11 red, 1010 green and 22 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.

Input

The first line contains a single integer tt (1≤t≤1001≤t≤100) — the number of sets of lamps Polycarp has bought.

Each of the next tt lines contains three integers rr, gg and bb (1≤r,g,b≤1091≤r,g,b≤109) — the number of red, green and blue lamps in the set, respectively.

Output

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

Example

input

Copy

3
3 3 3
1 10 2
2 1 1

output

Copy

Yes
No
Yes

Note

The first two sets are desribed in the statement.

The third set produces garland "RBRG", for example.

解题说明:水题,多一个无所谓,但是不能超过1个



#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>

using namespace std;

int main()
{
	int t;
	scanf("%d", &t);
	int r, g, b;
	for (; t > 0; t--)
	{
		scanf("%d %d %d", &r, &g, &b);
		if (r - g - b > 1 || g - r - b > 1 || b - g - r > 1)
		{
			printf("No\n");
		}
		else
		{
			printf("Yes\n");
		}
	}
	return 0;
}
发布了1749 篇原创文章 · 获赞 382 · 访问量 276万+

猜你喜欢

转载自blog.csdn.net/jj12345jj198999/article/details/104119020