PEG Test – Oct 3rd, 2014
Waterbending is characterized by being fluid and graceful, acting in concert with the environment. Young Avatar Aang is trying to master this unique art with the help of his friend Katara. Katara gives Aang three identical jars with equal amounts of water inside to practice on. Seeing how their practice is going so well, Sokka came over to play a prank. While Aang and Katara are taking a break, Sokka places a fish in one of those jars. Since Aang had just gotten used to the original weights of the jars, Sokka postulates that the added weight will surely throw him off.
What's more – the larger the fish, the more Aang will be thrown off. However, while Sokka was snickering to himself about how brilliant the prank was, he accidentally mixed up the jars. Now, given the weights of the jars, he would like to how much fish weighs so he can know just how much Aang will screw up.
Input Specification
There will be 3 lines of input in no particular order. Lines 1, 2, and 3 will each contain the weight of a jar (all positive integers ) – one of which will include the fish.
Output Specification
Output a single line containing a single integer – the weight of the fish.
Sample Input
12
17
12
Sample Output
5
Explanation
The second jar is heavier than both the first and the third one. Therefore it must contain the fish, which weighs .
Comments