Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Group equal sums
- # Read 3 numbers check if sum 13
- # Change only signs
- result = False
- checkMatrix = [
- [-1, -1, -1],
- [-1, -1, 1],
- [-1, 1, -1],
- [1, -1, -1],
- [-1, 1, 1],
- [1, 1, -1],
- [1, 1, 1]
- ]
- numbers = input().split(' ')
- for num in range(len(numbers)):
- numbers[num] = abs(int(numbers[num]))
- if sum(numbers) == 13:
- result = True
- else:
- for minus in checkMatrix:
- current_sum = sum([a * b for a, b in zip(numbers, minus)])
- if abs(current_sum) == 13:
- result = True
- break
- if result:
- print("Yes")
- else:
- print("No")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement