Advertisement
dchakarov81

Untitled

Feb 7th, 2020
1,809
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. n = int(input())
  2. left_sum = 0
  3. right_sum = 0
  4. for number in range(0, n*2):
  5.     current_num = int(input())
  6.     if number < n:
  7.         left_sum+=current_num
  8.     elif number >=n:
  9.         right_sum+=current_num
  10.  
  11. if left_sum == right_sum:
  12.     print('Yes, sum = ' + str(right_sum))
  13. else:
  14.     diff = abs(left_sum-right_sum)
  15.     print('No, diff = '+ str(diff))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement