atcoder#ABC270A. [ABC270A] 1-2-4 Test
[ABC270A] 1-2-4 Test
Score : points
Problem Statement
There was an exam consisting of three problems worth , , and points.
Takahashi, Aoki, and Snuke took this exam. Takahashi scored points, and Aoki scored points.
Snuke solved all of the problems solved by at least one of Takahashi and Aoki, and failed to solve any of the problems solved by neither of them.
Find Snuke's score.
It can be proved that Snuke's score is uniquely determined under the Constraints of this problem.
Constraints
- and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print Snuke's score as an integer.
1 2
3
Since Takahashi scored point, we see that he solved only the -point problem and failed to solve the other two. Similarly, since Aoki scored points, we see that he solved only the -point problem and failed to solve the other two.
Therefore, Snuke must have solved the - and -point problems, but not the -point one, which Takahashi and Aoki both failed to solve, for a score of points. Thus, should be printed.
5 3
7
Since Takahashi scored points, we see that he solved the - and -point problems but not the -point one. Similarly, since Aoki scored points, we see that he solved the - and -point problems but not the -point one.
Therefore, each of the three problems is solved by at least one of Takahashi and Aoki, so we see that Snuke solved all of the problems, for a score of points. Thus, should be printed.
0 0
0
Both Takahashi and Aoki solved none of the problems. Therefore, so did Snuke. Thus, should be printed.