Advertisement
Spocoman

08. Equal Pairs

Dec 26th, 2021 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. num = int(input())
  2. value = int(input()) + int(input())
  3. max_diff = 0
  4.  
  5. for i in range(num - 1):
  6.     current = int(input()) + int(input())
  7.     diff = abs(value - current)
  8.     if diff > max_diff:
  9.         max_diff = diff
  10.     else:
  11.         value = current
  12.  
  13. if max_diff == 0:
  14.     print(f'Yes, value={value}')
  15. else:
  16.     print(f'No, maxdiff={max_diff}')
  17.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement