Tips and Tricks

We will first input the number n, after that the first n numbers (left half) and sum them up. We will then proceed with inputting more n numbers (the right half) and sum them up. We calculate the difference between the sums by absolute value: Math.Abs(leftSum - rightSum). If the difference is 0, print "Yes" + the sum, otherwise - print "No" + the difference.

Testing in the Judge System

Test your solution here: https://judge.softuni.bg/Contests/Practice/Index/510#6.

results matching ""

    No results matching ""