310547: CF1850A. To My Critics

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

Description

A. To My Criticstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Suneet has three digits $a$, $b$, and $c$.

Since math isn't his strongest point, he asks you to determine if you can choose any two digits to make a sum greater or equal to $10$.

Output "YES" if there is such a pair, and "NO" otherwise.

Input

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

The only line of each test case contains three digits $a$, $b$, $c$ ($0 \leq a, b, c \leq 9$).

Output

For each test case, output "YES" if such a pair exists, and "NO" otherwise.

You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).

ExampleInput
5
8 1 2
4 4 5
9 9 9
0 0 0
8 5 3
Output
YES
NO
YES
NO
YES
Note

For the first test case, by choosing the digits $8$ and $2$ we can obtain a sum of $8 + 2 = 10$ which satisfies the condition, thus the output should be "YES".

For the second test case, any combination of chosen digits won't be at least $10$, thus the output should be "NO" (note that we can not choose the digit on the same position twice).

For the third test case, any combination of chosen digits will have a sum equal to $18$, thus the output should be "YES".

Input

题意翻译

#### 题目描述 Suneet有三个数字 $ a , b $ 和 $ c $。 由于数学不是他的强项,他请你判断是否可以选择任意两个数字使它们的和大于或等于 $ 10 $。 如果存在这样一对数字,输出 `YES`;否则,输出 `NO`。 #### 输入格式 第一行包含一个整数 $ t (( 1 \leq t \leq 1000 $)——测试用例的数量。 每个测试用例仅包含三个数字 $ a , b , c (( 0 \leq a, b, c \leq 9 $)。 #### 输出格式 对于每个测试用例,如果存在这样一对数字,输出 `YES`;否则,输出 `NO`。 Translated By @[ZeXic_B](https://www.luogu.com.cn/user/661274)

Output

题目大意:
Suneet有三个数字a、b和c。由于数学不是他的强项,他请你帮忙确定是否可以选择任意两个数字使它们的和大于或等于10。如果存在这样的数字对,输出"YES",否则输出"NO"。

输入数据格式:
第一行包含一个整数t(1≤t≤1000)——测试用例的数量。
每个测试用例只有一行,包含三个数字a、b、c(0≤a,b,c≤9)。

输出数据格式:
对于每个测试用例,如果存在这样的数字对,输出"YES",否则输出"NO"。
答案可以用任何大小写输出(例如,"yEs"、"yes"、"Yes"和"YES"都将被视为肯定答案)。

示例:
输入:
5
8 1 2
4 4 5
9 9 9
0 0 0
8 5 3

输出:
YES
NO
YES
NO
YES

注意:
在第一个测试用例中,选择数字8和2,我们可以得到8+2=10,满足条件,因此输出应为"YES"。
在第二个测试用例中,选择的任何数字组合都不会至少为10,因此输出应为"NO"(注意我们不能选择同一位置的数字两次)。
在第三个测试用例中,选择的任何数字组合的和都将等于18,因此输出应为"YES"。题目大意: Suneet有三个数字a、b和c。由于数学不是他的强项,他请你帮忙确定是否可以选择任意两个数字使它们的和大于或等于10。如果存在这样的数字对,输出"YES",否则输出"NO"。 输入数据格式: 第一行包含一个整数t(1≤t≤1000)——测试用例的数量。 每个测试用例只有一行,包含三个数字a、b、c(0≤a,b,c≤9)。 输出数据格式: 对于每个测试用例,如果存在这样的数字对,输出"YES",否则输出"NO"。 答案可以用任何大小写输出(例如,"yEs"、"yes"、"Yes"和"YES"都将被视为肯定答案)。 示例: 输入: 5 8 1 2 4 4 5 9 9 9 0 0 0 8 5 3 输出: YES NO YES NO YES 注意: 在第一个测试用例中,选择数字8和2,我们可以得到8+2=10,满足条件,因此输出应为"YES"。 在第二个测试用例中,选择的任何数字组合都不会至少为10,因此输出应为"NO"(注意我们不能选择同一位置的数字两次)。 在第三个测试用例中,选择的任何数字组合的和都将等于18,因此输出应为"YES"。

加入题单

上一题 下一题 算法标签: