Counting by 10s
Problem Statement
Baby Stephan just learned how to add numbers! Unfortunately, he only knows how to add two positive one-digit numbers that result in a sum of 10.
As a homework assignment one day, Stephan's teacher gives him () one-digit numbers and tells him to find the sum of the numbers. Stephan, using his limited addition knowledge mentioned above, finds his "answer" to the question by selecting a pair of numbers in the numbers such that he is able to add the two numbers in the pair up.
The next day, Stephan tells his teacher his "answer", and then his teacher tells Stephan how much he is off by.
Find how much Stephan is off by.
Input Format
The first line contains .
The second line contains the one-digit numbers (each between 1 and 9), with each number separated by a space.
Output Format
One line with the answer.
Constraints
- •
- • Each of the numbers is between 1 and 9
Sample Test Cases
Sample Input 1
6 1 2 3 4 6 7
Sample Output 1
3
Explanation: Stephan can choose the pairs (3, 7) and (4, 6), as he is able to do 3+7 and 4+6. The sum of 1+2+3+4+6+7 is 23, and 3+7+4+6=20. So the answer is 23-20=3.
Sample Input 2
5 5 5 5 5 5
Sample Output 2
5
Test Case Information
- • Test cases 3–6 satisfy .
- • Test cases 7–12 satisfy .
- • Test cases 13–20 satisfy .
Submit Solution (Practice)
Submission History
| ID | Language | Verdict | Score | Submitted (PST) | |
|---|---|---|---|---|---|
| No submissions yet. | |||||