Read problems statements [Mandarin] , [Bengali] , [Hindi] , [Russian] and [Vietnamese] as well.

There are three friends; let's call them A, B, C. They made the following statements:
A: "I have $x$ Rupees more than B."
B: "I have $y$ rupees more than C."
C: "I have $z$ rupees more than A."

You do not know the exact values of $x, y, z$. Instead, you are given their absolute values, i.e. $X = |x|$, $Y = |y|$ and $Z = |z|$. Note that $x$, $y$, $z$ may be negative; "having $-r$ rupees more" is the same as "having $r$ rupees less".

Find out if there is some way to assign amounts of money to A, B, C such that all of their statements are true.

------  Input ------
The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
The first and only line of each test case contains three space-separated integers $X$, $Y$ and $Z$.

------  Output ------
For each test case, print a single line containing the string "yes" if the presented scenario is possible or "no" otherwise (without quotes).

------  Constraints ------
$1 ≤ T ≤ 1,000$
$1 ≤ X, Y, Z ≤ 1,000$

------  Subtasks ------
Subtask #1 (30 points):
$1 ≤ T ≤ 30$
$1 ≤ X, Y, Z ≤ 3$

Subtask #2 (70 points): original constraints

----- Sample Input 1 ------ 
2

1 2 1

1 1 1
----- Sample Output 1 ------ 
yes

no
----- explanation 1 ------ 
Example 1: One possible way to satisfy all conditions is: A has $10$ rupees, B has $9$ rupees and C has $11$ rupees. Therefore, we have $x = 1$, $y = -2$, $z = 1$.

Example 2: There is no way for all conditions to be satisfied.

Difficulty: EASY
Tags: Mathematics

Implementation

Starter code:

Solutions:
for i in range(int(input())):
	(a, b, c) = map(int, input().split())
	if a + b == c or b + c == a or a + c == b:
		print('yes')
	else:
		print('no')


t = int(input())
for i in range(t):
	(x, y, z) = map(int, input().split())
	if x + z == y or x + y == z or y + z == x:
		print('yes')
	else:
		print('no')


for _ in range(int(input())):
	(x, y, z) = list(map(int, input().split()))
	if x + y == z or y + z == x or z + x == y:
		print('yes')
	else:
		print('no')


T = int(input())
for i in range(T):
	(X, Y, Z) = map(int, input().split())
	if X + Y == Z or Y + Z == X or X + Z == Y:
		print('yes')
	else:
		print('no')


t = int(input())
while t > 0:
	t -= 1
	(x, y, z) = map(int, input().split())
	if x + y == z or x + z == y or y + z == x:
		print('yes')
	else:
		print('no')


for T in range(int(input())):
	(x, y, z) = map(int, input().split())
	if x >= y and x >= z:
		if x - y - z == 0:
			print('yes')
		else:
			print('no')
	elif y >= x and y >= z:
		if y - x - z == 0:
			print('yes')
		else:
			print('no')
	elif z >= y and z >= x:
		if z - y - x == 0:
			print('yes')
		else:
			print('no')


t = int(input())
for i in range(t):
	(a, b, c) = map(int, input().split())
	if a == b + c:
		print('yes')
	elif b == c + a:
		print('yes')
	elif c == a + b:
		print('yes')
	else:
		print('no')


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	m = max(x, y, z)
	if m == x + y + z - m:
		print('yes')
	else:
		print('no')


for i in range(int(input())):
	(x, y, z) = map(int, input().split())
	e = max(x, y, z)
	d = e - (x + y + z - e)
	if d == 0:
		print('yes')
	else:
		print('no')


t = int(input())
for i in range(t):
	diff_list = list(map(int, input().split(' ')))
	neg = max(diff_list)
	diff_list.remove(neg)
	if diff_list[0] + diff_list[1] - neg == 0:
		print('yes')
	else:
		print('no')


t = int(input())
for i in range(t):
	(x, y, z) = list(map(int, input().split()))
	maximum = max(x, y, z)
	sum = x + y + z
	diff = sum - maximum
	if maximum == diff:
		print('yes')
	else:
		print('no')


t = int(input())
while t:
	(x, y, z) = [int(x) for x in input().split()]
	if x + y == z or y + z == x or z + x == y:
		print('yes')
	else:
		print('no')
	t -= 1


t = int(input())
for i in range(t):
	amounts = input().split(' ')
	l_amounts = [int(amounts[0]), int(amounts[1]), int(amounts[2])]
	l_amounts.sort()
	if l_amounts[-1] == l_amounts[0] + l_amounts[1]:
		print('yes')
	else:
		print('no')


t = int(input())
i = 1
while i <= t:
	(a, b, c) = map(int, input().split())
	if a + b == c or b + c == a or c + a == b:
		print('yes')
	else:
		print('no')
	i += 1


for i in range(int(input())):
	(X, Y, Z) = map(int, input().split())
	A = [X, Y, Z, X, Y]
	c = 0
	for j in range(3):
		if A[j] + A[j + 1] == A[j + 2]:
			print('yes')
			c += 1
			break
	if c == 0:
		print('no')