Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- n = int(input())
- max_num = -sys.maxsize -1
- total = 0
- for i in range(0, n):
- num = int(input())
- if num > max_num:
- max_num = num
- total += num
- diff = abs(max_num-total)
- if diff == max_num:
- print(f"Yes")
- print(f"Sum = {max_num}")
- else:
- print(f"No")
- print(f"Diff = {abs(max_num - diff)}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement