Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- difference = list()
- summa = 0
- for i in range(int(input())):
- a, b = map(int, input().split())
- if a < b:
- summa += a
- else:
- summa += b
- difference.append(abs(a-b))
- print(f'summa = {summa}')
- to_add_for_end_is_7 = 7 - summa % 10
- print(f'need to add something that ends with {to_add_for_end_is_7}')
- difference.sort()
- for i in difference:
- if i % 10 == to_add_for_end_is_7:
- print(f'can add {i}')
- print('otvet = ', summa + i) # file a and b answers 8317 19596697
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement