Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- sums = 0
- prev_sum = 0
- diff = 0
- max_diff = 0
- for i in range(1, n+1):
- sums += int(input())
- sums += int(input())
- if i > 1:
- diff = abs(sums - prev_sum)
- if diff > max_diff:
- max_diff = diff
- prev_sum = sums
- sums = 0
- if max_diff == 0:
- print(f"Yes, value={prev_sum}")
- else:
- print(f"No, maxdiff={max_diff}")
Add Comment
Please, Sign In to add comment