AtCoder Beginner Contest 093
C
Same Integers
AtCoder
⌀ 301
原题
← BD →
翻译中…

Problem Statement

翻译中…

You are given three integers $A$, $B$ and $C$. Find the minimum number of operations required to make $A$, $B$ and $C$ all equal by repeatedly performing the following two kinds of operations in any order:

翻译中…
  • Choose two among $A$, $B$ and $C$, then increase both by $1$.
  • Choose one among $A$, $B$ and $C$, then increase it by $2$.
翻译中…

It can be proved that we can always make $A$, $B$ and $C$ all equal by repeatedly performing these operations.

翻译中…

Constraints

翻译中…
  • $0 \leq A,B,C \leq 50$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

A B C

翻译中…

Output

翻译中…

Print the minimum number of operations required to make $A$, $B$ and $C$ all equal.

翻译中…

样例

Input #1
2 5 4
Output #1
2
We can make $A$, $B$ and $C$ all equal by the following operations: - Increase $A$ and $C$ by $1$. Now, $A$, $B$, $C$ are $3$, $5$, $5$, respectively. - Increase $A$ by $2$. Now, $A$, $B$, $C$ are $5$, $5$, $5$, respectively.
Input #2
2 6 3
Output #2
5
Input #3
31 41 5
Output #3
23
题目信息
题号
arc094_a
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。