#arc094a. [arc094_a]Same Integers
[arc094_a]Same Integers
Problem Statement
You are given three integers , and . Find the minimum number of operations required to make , and all equal by repeatedly performing the following two kinds of operations in any order:
- Choose two among , and , then increase both by .
- Choose one among , and , then increase it by .
It can be proved that we can always make , and all equal by repeatedly performing these operations.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum number of operations required to make , and all equal.
Sample Input 1
2 5 4
Sample Output 1
2
We can make , and all equal by the following operations:
- Increase and by . Now, , , are , , , respectively.
- Increase by . Now, , , are , , , respectively.
Sample Input 2
2 6 3
Sample Output 2
5
Sample Input 3
31 41 5
Sample Output 3
23