Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count_pair = int(input())
- check_count = 2 * count_pair
- pair = 0
- a = 0
- list_pair = []
- while check_count:
- num = int(input())
- pair = pair + num
- a = a + 1
- if a == 2:
- list_pair.append(pair)
- pair = 0
- a = 0
- check_count -= 1
- equ = True
- first_num = list_pair[0]
- for number in list_pair:
- if number != first_num:
- equ = False
- break
- max_diff = 0
- for x in range(len(list_pair)):
- for y in range(x + 1, len(list_pair)):
- if (abs(list_pair[x] - list_pair[y])) > max_diff:
- max_diff = abs(list_pair[x] - list_pair[y])
- if equ:
- print(f'Yes, value={list_pair[0]}')
- else:
- print(f'No, maxdiff={max_diff}')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement