#abc362a. A - Buy a Pen
A - Buy a Pen
Score : points
问题陈述
高桥来到一家商店买笔。在这里,一支红色笔的价格是R日元,一支绿色笔的价格是G日元,一支蓝色笔的价格是B日元。
高桥不喜欢颜色C。如果C是红色
,他就不能买红色笔;如果C是绿色
,他就不能买绿色笔;如果C是蓝色
,他就不能买蓝色笔。
确定他买一支笔所需的最少金额。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
Takahashi came to a store to buy a pen. Here, a red pen costs yen, a green pen costs yen, and a blue pen costs yen.
Takahashi dislikes the color . If is Red
, he cannot buy a red pen; if is Green
, he cannot buy a green pen; and if is Blue
, he cannot buy a blue pen.
Determine the minimum amount of money he needs to buy one pen.
Constraints
- , , and are integers.
- is
Red
,Green
, orBlue
.
Input
The input is given from Standard Input in the following format:
Output
If the minimum amount of money Takahashi needs to buy one pen is yen, print .
Sample Input 1
20 30 10
Blue
Sample Output 1
20
A red pen costs yen, a green pen costs yen, and a blue pen costs yen. Takahashi cannot buy a blue pen, but he can buy a red pen for yen.
Sample Input 2
100 100 100
Red
Sample Output 2
100
Sample Input 3
37 39 93
Blue
Sample Output 3
37