102700: [AtCoder]ABC270 A - 1-2-4 Test

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:9 Solved:0

Description

Score : $100$ points

Problem Statement

There was an exam consisting of three problems worth $1$, $2$, and $4$ points.

Takahashi, Aoki, and Snuke took this exam. Takahashi scored $A$ points, and Aoki scored $B$ 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

  • $0\leq A,B \leq 7$
  • $A$ and $B$ are integers.

Input

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

$A$ $B$

Output

Print Snuke's score as an integer.


Sample Input 1

1 2

Sample Output 1

3

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

Therefore, Snuke must have solved the $1$- and $2$-point problems, but not the $4$-point one, which Takahashi and Aoki both failed to solve, for a score of $3$ points. Thus, $3$ should be printed.


Sample Input 2

5 3

Sample Output 2

7

Since Takahashi scored $5$ points, we see that he solved the $1$- and $4$-point problems but not the $2$-point one.
Similarly, since Aoki scored $3$ points, we see that he solved the $1$- and $2$-point problems but not the $4$-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 $7$ points. Thus, $7$ 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, $0$ should be printed.

Input

题意翻译

一场考试有 $3$ 道题,分值分别是 $1$,$2$,$4$。 Takahashi, Aoki, 和 Snuke 参加了这场考试,Takahashi 得分为 $A$,Aoki 得分为 $B$,Snuke解决了 Takahashi 和 Aoki 至少一个人解决的问题,并且未能解决他们两人都没有解决的问题。 求 Snuke 的分数。

Output

分数:100分 部分 问题描述 有一场考试,包含三个问题,分别价值1分、2分和4分。 Takahashi、Aoki和Snuke参加了这场考试。 Takahashi得了A分,Aoki得了B分。 Snuke解决了至少被Takahashi和Aoki中的一人解决的所有问题,并且没有解决他们都没有解决的任何问题。 求Snuke的分数。 可以证明,在本问题的约束下,Snuke的分数是唯一确定的。 部分 约束
  • 0≤A,B≤7
  • A和B是整数。
部分 输入 输入格式如下,从标准输入给出: A B 部分 输出 将Snuke的分数作为整数打印。 部分 样例输入1 1 2 部分 样例输出1 3 因为Takahashi得了1分,我们看到他只解决了1分问题,没有解决其他两个问题。 同样,因为Aoki得了2分,我们看到他只解决了2分问题,没有解决其他两个问题。 因此,Snuke必须解决了1分和2分问题,但没有解决4分问题,这是Takahashi和Aoki都未能解决的问题,因此得到了3分的分数。因此,应该打印3。 部分 样例输入2 5 3 部分 样例输出2 7 因为Takahashi得了5分,我们看到他解决了1分和4分问题,但没有解决2分问题。 同样,因为Aoki得了3分,我们看到他解决了1分和2分问题,但没有解决4分问题。 因此,三个问题中有至少一个被Takahashi和Aoki解决,所以我们看到Snuke解决了所有问题,得到了7分的分数。因此,应该打印7。 部分 样例输入3 0 0 部分 样例输出3 0 Takahashi和Aoki都没有解决任何问题。因此,Snuke也没有。因此,应该打印0。

加入题单

上一题 下一题 算法标签: