103550: [Atcoder]ABC355 A - Who Ate the Cake?

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

Description

Score : $100$ points

Problem Statement

Takahashi's cake has been eaten by someone. There are three suspects: person $1$, person $2$, and person $3$.

There are two witnesses, Ringo and Snuke. Ringo remembers that person $A$ is not the culprit, and Snuke remembers that person $B$ is not the culprit.

Determine if the culprit can be uniquely identified based on the memories of the two witnesses. If the culprit can be identified, print the person's number.

Constraints

  • $1 \leq A, B \leq 3$
  • All input values are integers.

Input

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

$A$ $B$

Output

If the culprit can be uniquely identified based on the memories of the two witnesses, print the person's number; otherwise, print -1.


Sample Input 1

1 2

Sample Output 1

3

From the memories of the two witnesses, it can be determined that person $3$ is the culprit.


Sample Input 2

1 1

Sample Output 2

-1

From the memories of the two witnesses, it cannot be determined whether person $2$ or person $3$ is the culprit. Therefore, print -1.


Sample Input 3

3 1

Sample Output 3

2

Output

分数:100分

问题描述

高桥的蛋糕被某人吃了。有三个嫌疑人:1 号、2 号和 3 号。

有两个目击者,林檎和Snuk。林檎记得 1 号不是罪犯,而Snuk记得 2 号不是罪犯。

根据两个目击者的记忆判断是否能唯一确定罪犯。如果能确定罪犯,输出该人的号码。

限制条件

  • $1 \leq A, B \leq 3$
  • 所有输入值都是整数。

输入

输入从标准输入按以下格式给出:

$A$ $B$

输出

如果根据两个目击者的记忆能唯一确定罪犯,输出该人的号码;否则,输出 -1


样例输入 1

1 2

样例输出 1

3

根据两个目击者的记忆,可以确定 3 号是罪犯。


样例输入 2

1 1

样例输出 2

-1

根据两个目击者的记忆,无法确定是 2 号还是 3 号是罪犯。因此,输出 -1


样例输入 3

3 1

样例输出 3

2

加入题单

上一题 下一题 算法标签: