题目描述
Problem Description
Aoi and Rin, students at JOI High School, decided to eat konpeito candies together with their teacher, Rie.
Currently, Aoi has eaten \( A \) candies, Rin has eaten \( B \) candies, and Rie has eaten \( C \) candies. To make the number of candies eaten by all three equal, what is the minimum total number of additional candies they need to eat?
Given the number of candies \( A, B, C \) eaten by the three, write a program to find the minimum number of additional candies they need to eat.
Input Format
The input is given from the standard input in the following format:
\( A \) \( B \) \( C \)
Output Format
Output the minimum number of additional candies to be eaten on a single line to the standard output.
Sample Input and Output
Sample Input #1
4 6 9
Sample Output #1
8
Sample Input #2
35 35 35
Sample Output #2
0
Notes/Hints
Constraints
- \( 1 \leq A \leq 100 \).
- \( 1 \leq B \leq 100 \).
- \( 1 \leq C \leq 100 \).
- All input values are integers.
Subtasks
- (40 points) \( A < B < C \).
- (60 points) No additional constraints.
Grading Notes
All submissions are graded on the judge system.
The submitted source code is considered correct for a subtask if it returns the correct result for all test input data corresponding to that subtask.
The score for each submission is the sum of the points for the subtasks that the submitted source code correctly solves.
The score for this task is the maximum score of all submissions for this task.
The current score can be checked from the "My Score Status" tab in the "Submission Results".
Sample Explanation 1
Aoi has eaten 4 candies, Rin has eaten 6 candies, and Rie has eaten 9 candies. If Aoi eats 5 more candies and Rin eats 3 more candies, all three will have eaten 9 candies each. The total additional candies eaten in this case is 8. It is impossible to equalize the number of candies with less than 8 additional candies, so output 8. This input example satisfies the constraints of all subtasks.
Sample Explanation 2
No additional candies need to be eaten, so output 0. This input example satisfies only the constraints of subtask 2.
输入格式
见题面 Input 部分
输出格式
见题面 Output 部分