Do You Know Your ABCs?
InterviewTime limit1sMemory limit512 MB
Given seven numbers that are A, B, C and their pairwise and total sums in some order, recover the three sorted positive integers.
- Level
Easy3 of 10
- Topics
- Sorting, Math, Implementation
- Solved
- No attempts yet
Problem
Farmer John's cows hold a daily online gathering on the "mooZ" video meeting platform. For fun, they have invented a simple number game to play during the meeting.
Elsie has three positive integers , , and (). These integers are supposed to be secret, so she will not tell them directly to her sister Bessie. Instead, she gives Bessie seven integers in the range (not necessarily distinct), claiming that they are , , , , , , and in some order.
Given these seven numbers, help Bessie determine , , and . The answer is unique.
Input
The only line of input contains seven space-separated integers.
Output
Print , , and , separated by spaces.