AtCoder Beginner Contest 047 - Fighting over Candies

Two students of AtCoder Kindergarten are fighting over candy packs.
There are three candy packs, each of which contains a, b, and c candies, respectively.
Teacher Evi is trying to distribute the packs between the two students so that each student gets the same number of candies. Determine whether it is possible.
Note that Evi cannot take candies out of the packs, and the whole contents of each pack must be given to one of the students.

-----Constraints-----
 - 1 ≦ a, b, c ≦ 100

-----Input-----
The input is given from Standard Input in the following format:
a b c

-----Output-----
If it is possible to distribute the packs so that each student gets the same number of candies, print Yes. Otherwise, print No.

-----Sample Input-----
10 30 20

-----Sample Output-----
Yes

Give the pack with 30 candies to one student, and give the two packs with 10 and 20 candies to the other. Then, each gets 30 candies.

Source: atcoder | Difficulty: EASY


Solutions:
(a, b, c) = map(int, input().split())
if a == b + c or b == a + c or c == a + b:
	print('Yes')
else:
	print('No')


a = sorted(list(map(int, input().split())))
print('Yes' if a.pop() == sum(a) else 'No')


a = list(map(int, input().split()))
print('Yes' if max(a) == sorted(a)[-2] + min(a) else 'No')


(a, b, c) = map(int, input().split())
print('Yes') if max(a, b, c) * 2 == a + b + c else print('No')


A = list(map(int, input().split()))
A.sort()
print('Yes' if A[2] - A[0] == A[1] else 'No')


A = sorted(map(int, input().split()))
print('Yes' if A[2] == A[0] + A[1] else 'No')


a = list(map(int, input().split()))
print('NYoe s'[sum(a) / 2 in a::2])


c = sorted(list(map(int, input().split())))
print('Yes' if c[0] + c[1] == c[2] else 'No')


packs = list(map(int, input().split()))
if packs[0] + packs[1] == packs[2] or packs[0] + packs[2] == packs[1] or packs[2] + packs[1] == packs[0]:
	print('Yes')
else:
	print('No')


a = list(map(int, input().split()))
print('Yes' if max(a) * 2 == sum(a) else 'No')


(a, b, c) = sorted(map(int, input().split()))
print('NYoe s'[a + b == c::2])


n = [int(i) for i in input().split()]
print('Yes' if max(n) * 2 == sum(n) else 'No')


A = sorted(map(int, input().split()))
print('YNeos'[A[0] + A[1] != A[2]::2])


S = sorted(list(map(int, input().split())))
print('Yes' if sum(S[:2]) == S[2] else 'No')


a = [int(i) for i in input().split()]
a.sort()
print('Yes' if a[0] + a[1] == a[2] else 'No')


a = list(map(int, input().split()))
a.sort()
print(['No', 'Yes'][max(a) - min(a) == a[1]])


(a, b, c) = map(int, input().split())
print('NYoe s'[(a + b + c) / 2 in [a, b, c]::2])


(*i,) = map(int, input().split())
print('Yes' if max(i) * 2 == sum(i) else 'No')


(S, M, L) = sorted(list(map(int, input().split())))
print('Yes' if S + M == L else 'No')


A = sorted(map(int, input().split()))
print('Yes' if A[2] == sum(A[:2]) else 'No')


(A, B, C) = sorted(map(int, input().split()))
print('YNeos'[A + B != C::2])


(a, b, c) = map(int, input().split())
print('YNeos'[not a + b + c == max(a, b, c) * 2::2])


(A, B, C) = [int(i) for i in input().split()]
x = max(A, B, C)
s = sum([A, B, C])
y = s - x
if x == y:
	print('Yes')
else:
	print('No')


(A, B, C) = sorted(map(int, input().split()))
print('Yes' if A + B == C else 'No')


a = list(map(int, input().split()))
print(['No', 'Yes'][max(a) == sum(a) - max(a)])


(*ab, c) = sorted(map(int, input().split()))
print(['No', 'Yes'][sum(ab) == c])


a = [int(i) for i in input().split()]
print('Yes' if max(a) == sum(a) - max(a) else 'No')


(a, b, c) = list(map(int, input().split()))
if (1 <= a <= 100) & (1 <= b <= 100) & (1 <= c <= 100):
	if (a + b == c) | (a == b + c) | (a + c == b):
		print('Yes')
	else:
		print('No')


import sys
from io import StringIO
import unittest

class TestClass(unittest.TestCase):

	def assertIO(self, input, output):
		(stdout, stdin) = (sys.stdout, sys.stdin)
		(sys.stdout, sys.stdin) = (StringIO(), StringIO(input))
		resolve()
		sys.stdout.seek(0)
		out = sys.stdout.read()[:-1]
		(sys.stdout, sys.stdin) = (stdout, stdin)
		self.assertEqual(out, output)

	def test_入力例_1(self):
		input = '10 30 20'
		output = 'Yes'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '30 30 100'
		output = 'No'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '56 25 31'
		output = 'Yes'
		self.assertIO(input, output)

def resolve():
	C = list(map(int, input().split()))
	C.sort()
	if C[2] == C[0] + C[1]:
		print('Yes')
	else:
		print('No')

def __starting_point():
	resolve()
__starting_point()


(a, b, c) = list(map(int, input().split()))
s = (a + b + c) / 2
if s == a or s == b or s == c:
	print('Yes')
else:
	print('No')


(a, b, c) = map(int, input().split())
print(['No', 'Yes'][(a + b == c) + (b + c == a) + (c + a == b)])


(a, b, c) = sorted(map(int, input().split()))
print('YNeos'[a + b != c::2])


a = list(map(int, input().split()))
a.sort()
print('YNeos'[a[0] + a[1] != a[2]::2])


a = list(map(int, input().split()))
print('YNeos'[sum(a) != max(a) * 2::2])


L = list(map(int, input().split()))
L.sort()
print('Yes' if sum(L[:2]) == L[2] else 'No')


A = list(map(int, input().split()))
print(('No', 'Yes')[sum(A) / 2 in A])


l = list(map(int, input().split()))
l1 = sorted(l, reverse=True)
s = sum(l1)
if l1[0] == s / 2:
	print('Yes')
else:
	print('No')


l = list(map(int, input().split()))
l.sort()
print('YNeos'[l[0] + l[1] != l[2]::2])


l = list(map(int, input().split()))
print('YNeos'[sum(l) != max(l) * 2::2])


A = [int(x) for x in input().split()]
print('Yes' if sum(A) / 2 in A else 'No')


(a, b, c) = map(int, input().split())
li = sorted([a, b, c])
ans = 'No'
if sum(li[:2]) == li[2]:
	ans = 'Yes'
print(ans)


A = list(map(int, input().split()))
print(('No', 'Yes')[max(A) == sum(A) - max(A)])


a = list(map(int, input().split()))
a.sort()
print(['No', 'Yes'][a[0] + a[1] == a[2]])


(a, b, c) = sorted(list(map(int, input().split())))
print('Yes' if a + b == c else 'No')


l = sorted(list(map(int, input().split())))
print('YNeos'[l[0] + l[1] - l[2] != 0::2])


a = sorted(map(int, input().split()))
print('Yes' if a[-1] == sum(a[:-1]) else 'No')


(a, b, c) = map(int, input().split())
print('YNeos'[a + b != c and a + c != b and (b + c != a)::2])


import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10 ** 9)

def si():
	return input()

def ii():
	return int(input())

def fi():
	return float(input())

def lint():
	return list(map(int, input().split()))

def lint_dec():
	return list([int(x) - 1 for x in input().split()])

def lnstr(n):
	return [input() for _ in range(n)]

def lnint(n):
	return [int(input()) for _ in range(n)]

def lint_list(n):
	return [lint() for _ in range(n)]
(a, b, c) = sorted(lint())
print('Yes' if a + b == c else 'No')


x = sorted((int(s) for s in input().split()))
print('Yes' if sum(x[:-1]) == x[2] else 'No')


x = list(map(int, input().split(' ')))
if x[0] == x[1] + x[2]:
	print('Yes')
elif x[0] + x[1] == x[2]:
	print('Yes')
elif x[0] + x[2] == x[1]:
	print('Yes')
else:
	print('No')


s = sorted(list(map(int, input().split())))
print('NYoe s'[s[-1] == sum(s[:2])::2])


x = list(map(int, input().split()))
y = sorted(x)
if y[0] + y[1] == y[2]:
	print('Yes')
else:
	print('No')


def solve():
	(a, b, c) = map(int, input().split())
	if a == b + c or b == a + c or c == a + b:
		print('Yes')
	else:
		print('No')

def __starting_point():
	solve()
__starting_point()


print((lambda x: 'Yes' if max(x) * 2 == sum(x) else 'No')(list(map(int, input().split()))))


(l, m, h) = sorted(map(int, input().split()))
print(['No', 'Yes'][h == l + m])


(a, b, c) = list(map(int, input().split()))
ma = max(a, b, c)
rem = a + b + c - ma
if ma == rem:
	print('Yes')
else:
	print('No')


ans = ['No', 'Yes']
candy = list(map(int, input().split()))
print(ans[sum(candy) / 2 in candy])


n = list(map(int, input().split()))
print('Yes' if n.count(sum(n) // 2) == 1 else 'No')


str_line = input().split(' ')
num_line = [int(n) for n in str_line]
num_line.sort()
if num_line[2] == num_line[1] + num_line[0]:
	print('Yes')
else:
	print('No')


(a, b, c) = map(int, input().split())
list = [a, b, c]
list.sort()
if list[0] + list[1] == list[2]:
	print('Yes')
else:
	print('No')


(x, y, z) = sorted(map(int, input().split()))
print('YNeos'[x + y != z::2])


l = sorted(map(int, input().split()))
print(['No', 'Yes'][l[2] * 2 == sum(l)])


c = list(map(int, input().split()))
print('Yes' if max(c) == sum(c) - max(c) else 'No')


(a, b, c) = sorted(map(int, input().split()), reverse=True)
print('Yes') if a == b + c else print('No')


(a, b, c) = map(int, input().split())
jdg = False
if a + b == c:
	jdg = True
if b + c == a:
	jdg = True
if c + a == b:
	jdg = True
print('Yes' if jdg else 'No')


(a, b, c) = map(int, input().split())
s = sum([a, b, c])
m = max(a, b, c)
if m == s - m:
	print('Yes')
else:
	print('No')


(a, b, c) = list(map(int, input().split()))
result = 'ret'
if a + b == c:
	result = 'Yes'
elif a + c == b:
	result = 'Yes'
elif b + c == a:
	result = 'Yes'
else:
	result = 'No'
print(result)


(a, b, c) = list(map(int, input().split()))
result = 'No'
if a + b == c or a + c == b or a == b + c:
	result = 'Yes'
print(result)


a = list(map(int, input().split()))
b = sorted(a)
print(['No', 'Yes'][b[2] == b[1] + b[0]])


a = list(map(int, input().split()))
a.sort()
if a[0] + a[2] == a[1] or a[0] + a[1] == a[2]:
	print('Yes')
else:
	print('No')


s = input()
print('NYoe s'[' 2' in s or ' 5' in s::2])


(a, b, c) = map(int, input().split())
print('YNeos'[a + b != c != abs(a - b)::2])


def main():
	t = list(map(int, input().split()))
	if sum(t[0:2]) == t[2] or sum(t[1:]) == t[0] or sum(t[::2]) == t[1]:
		print('Yes')
	else:
		print('No')

def __starting_point():
	main()
__starting_point()


(a, b, c) = map(int, input().split())
print('NYoe s'[a + b == c or a + c == b or a == b + c::2])


def iroha():
	li = list(map(int, input().split()))
	li.sort()
	merge = li[0] + li[1]
	if merge == li[2]:
		print('Yes')
	else:
		print('No')

def __starting_point():
	iroha()
__starting_point()


x = list(map(int, input().split()))
x.sort()
print(['No', 'Yes'][2 * x[2] == sum(x)])


l = list(map(int, input().split()))
print('Yes') if (e := sum(l)) % 2 == 0 and e // 2 in l else print('No')


A = tuple(map(int, input().split()))
print('Yes' if sum(A) == 2 * max(A) else 'No')


a = list(map(int, input().split()))
b = a.pop(a.index(max(a)))
if b == sum(a):
	print('Yes')
else:
	print('No')


L = list(map(int, input().split()))
print('YNeos'[2 * max(L) != sum(L)::2])


import sys
sys.setrecursionlimit(250000)

def main():
	(a, b, c) = list(map(int, input().split()))
	if a == b + c:
		print('Yes')
	elif b == a + c:
		print('Yes')
	elif c == a + b:
		print('Yes')
	else:
		print('No')
main()


A = [int(x) for x in input().split()]
A.sort()
print('Yes' if A[0] + A[1] == A[2] else 'No')


(a, b, c) = map(int, input().split())
d = max(a, b, c)
print(['No', 'Yes'][d == a + b + c - d])


l = list(map(int, input().split()))
print('Yes') if sum(l) / 2 in l else print('No')


data = list(input().split())
if int(data[0]) > int(data[1]) and int(data[0]) > int(data[2]):
	if int(data[0]) == int(data[1]) + int(data[2]):
		print('Yes')
	else:
		print('No')
elif int(data[1]) > int(data[0]) and int(data[1]) > int(data[2]):
	if int(data[1]) == int(data[0]) + int(data[2]):
		print('Yes')
	else:
		print('No')
elif int(data[2]) > int(data[1]) and int(data[2]) > int(data[0]):
	if int(data[2]) == int(data[1]) + int(data[0]):
		print('Yes')
	else:
		print('No')
else:
	print('No')


candy = sorted([int(x) for x in input().split()])
if candy[0] + candy[1] == candy[2]:
	print('Yes')
else:
	print('No')


c = sorted(map(int, input().split()))
print(['No', 'Yes'][c[0] + c[1] == c[2]])


abc = list(map(int, input().split()))
abc_max = max(abc)
abc2 = abc
abc2.remove(abc_max)
if abc_max == sum(abc2):
	print('Yes')
else:
	print('No')


S_list = list(map(int, input().split()))
S_max = max(S_list)
answer = sum(S_list) / S_max
if answer == 2:
	result = 'Yes'
else:
	result = 'No'
print(result)


(a, b, c) = map(int, input().split())
sortlist = sorted([a, b, c])
if sortlist[0] + sortlist[1] == sortlist[2]:
	print('Yes')
else:
	print('No')


(x, y, z) = sorted(map(int, input().split()))
print(['No', 'Yes'][x + y == z])