Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
531 B
1
Indexable
Never
count_of_numbers = int(input())

sum_of_first_digits = 0
sum_of_second_digits = 0

for number in range(2 * count_of_numbers):
    current_number = int(input())
    if number < count_of_numbers:
        sum_of_first_digits = sum_of_first_digits + current_number
    else:
        sum_of_second_digits = sum_of_second_digits + current_number

if sum_of_second_digits == sum_of_first_digits:
    print(f'Yes, sum = {sum_of_first_digits}')
else:
    print(f'No, diff = {abs(sum_of_second_digits - sum_of_first_digits)}')
Leave a Comment