#abc270a. A - 1-2-4 Test

A - 1-2-4 Test

Score : 100100 points

问题描述

一场考试包含三道题目,每题分别价值112244分。

高桥、青木和须贝参加了这场考试。高桥得分为AA分,青木得分为BB分。

须贝解决掉了高桥和青木中至少一人解决的所有题目,并且未能解决他们两人都未解决的任何题目。

求须贝的得分。

可以证明,在本题设定的条件下,须贝的得分是唯一确定的。

以上为通义千问 qwen-max 翻译,仅供参考。

Problem Statement

There was an exam consisting of three problems worth 11, 22, and 44 points.

Takahashi, Aoki, and Snuke took this exam. Takahashi scored AA points, and Aoki scored BB 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

  • 0A,B70\leq A,B \leq 7
  • AA and BB are integers.

Input

The input is given from Standard Input in the following format:

AA BB

Output

Print Snuke's score as an integer.

Sample Input 1

1 2

Sample Output 1

3

Since Takahashi scored 11 point, we see that he solved only the 11-point problem and failed to solve the other two.
Similarly, since Aoki scored 22 points, we see that he solved only the 22-point problem and failed to solve the other two.

Therefore, Snuke must have solved the 11- and 22-point problems, but not the 44-point one, which Takahashi and Aoki both failed to solve, for a score of 33 points. Thus, 33 should be printed.

Sample Input 2

5 3

Sample Output 2

7

Since Takahashi scored 55 points, we see that he solved the 11- and 44-point problems but not the 22-point one.
Similarly, since Aoki scored 33 points, we see that he solved the 11- and 22-point problems but not the 44-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 77 points. Thus, 77 should be printed.

Sample Input 3

0 0

Sample Output 3

0

Both Takahashi and Aoki solved none of the problems. Therefore, so did Snuke. Thus, 00 should be printed.

update @ 2024/3/10 11:22:43