No.920 Red and Blue
問題文最終更新日: 2019-11-08 19:59:09
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 230
(順位表)
の他の問題:
If you are experiencing an issue where mathematical formulas are not displayed, please take the following steps.
https://twitter.com/yukicoder/status/1191757446596812800?s=20
Problem Statement
Initially, there are $X$ red balls, $Y$ blue balls, and $Z$ white balls.
Yukari can perform the following operations any number of times.
- Replace $1$ white ball with $1$ red ball.
- Replace $1$ white ball with $1$ blue ball.
- Make $1$ purple ball from $1$ red ball and $1$ blue ball.
Input
$X\ Y\ Z$
- $0 \le X, Y, Z \le 20$
- All inputs are integers.
Output
Output the maximum number as an integer on one line.
Sample
Sample 1
Input
3 4 5
Output
6
By changing the $5$ white balls into $3$ red balls and $2$ blue balls, you can make $6$ purple balls.
Sample 2
Input
1 5 8
Output
7
Sample 3
Input
1 5 9
Output
7
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
lumc_