Untitled
unknown
plain_text
7 months ago
622 B
1
Indexable
Never
from math import inf number_goups = int(input()) sum_current_pair = 0 sum_previous_pair = 0 max_sum = -inf min_sum = inf difference = 0 for group in range(number_goups): number_one = int(input()) number_two = int(input()) sum_current_pair = number_one + number_two if group == 0: sum_previous_pair = sum_current_pair else: difference = sum_current_pair - sum_previous_pair sum_previous_pair = sum_current_pair # diff = max_sum - min_sum if difference != 0: print(f"No, maxdiff={abs(difference)}") else: print(f"Yes, value={sum_current_pair} ")
Leave a Comment