##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
You are given three integers , , and .
In one operation, you may choose one of the three numbers and either increase it by or decrease it by .
Find the minimum number of operations needed to make equal to the arithmetic mean of and .
In other words, after the operations, the condition must hold.
The number is already the arithmetic mean of and , so no operation is needed.
If we decrease by , the numbers become , and is the arithmetic mean of and .
We can increase from to using operations. Then becomes the arithmetic mean of and .
We can decrease from to using operations. Then becomes the arithmetic mean of and .
For example, we can increase from to using operations. Then the numbers are . After decreasing by , the numbers become , and is the arithmetic mean of and .