#abc355a. A - Who Ate the Cake?
A - Who Ate the Cake?
Score : points
问题陈述
高桥的蛋糕被人吃了。有三个嫌疑人:人 ,人 ,和人 。
有两个证人,林果和斯努克。林果记得人 不是罪犯,斯努克记得人 不是罪犯。
根据两个证人的记忆,确定是否可以唯一确定罪犯。如果可以确定罪犯,请打印出这个人的编号。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
Takahashi's cake has been eaten by someone. There are three suspects: person , person , and person .
There are two witnesses, Ringo and Snuke. Ringo remembers that person is not the culprit, and Snuke remembers that person 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
- All input values are integers.
Input
The input is given from Standard Input in the following format:
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 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 or person is the culprit. Therefore, print -1
.
Sample Input 3
3 1
Sample Output 3
2