CF1622A.Construct a Rectangle
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
There are three sticks with integer lengths l1,l2 and l3 .
You are asked to break exactly one of them into two pieces in such a way that:
- both pieces have positive (strictly greater than 0 ) integer length;
- the total length of the pieces is equal to the original length of the stick;
- it's possible to construct a rectangle from the resulting four sticks such that each stick is used as exactly one of its sides.
A square is also considered a rectangle.
Determine if it's possible to do that.
输入格式
The first line contains a single integer t ( 1≤t≤104 ) — the number of testcases.
The only line of each testcase contains three integers l1,l2,l3 ( 1≤li≤108 ) — the lengths of the sticks.
输出格式
For each testcase, print "YES" if it's possible to break one of the sticks into two pieces with positive integer length in such a way that it's possible to construct a rectangle from the resulting four sticks. 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 a positive answer).
输入输出样例
输入#1
4 6 1 5 2 5 2 2 4 2 5 5 4
输出#1
YES NO YES YES
说明/提示
In the first testcase, the first stick can be broken into parts of length 1 and 5 . We can construct a rectangle with opposite sides of length 1 and 5 .
In the second testcase, breaking the stick of length 2 can only result in sticks of lengths 1,1,2,5 , which can't be made into a rectangle. Breaking the stick of length 5 can produce results 2,3 or 1,4 but neither of them can't be put into a rectangle.
In the third testcase, the second stick can be broken into parts of length 2 and 2 . The resulting rectangle has opposite sides 2 and 2 (which is a square).
In the fourth testcase, the third stick can be broken into parts of length 2 and 2 . The resulting rectangle has opposite sides 2 and 5 .