By Kay Akashi
You're given red sticks, green sticks, and blue sticks of equal length. Your task is to create a non-degenerate triangle by using those sticks. In this game, sticks of the same colour should align on a single line. However, you notice that in some cases you're short of some sticks to achieve this task. Report the minimum number of sticks of any colour you additionally need in order to achieve this task.
In this game, you're not allowed to leave any sticks unused. In other words, you have to use all sticks you have in your hand.
.
The input contains three integers , , and in a single line.
Output the answer.
4 7 1
3
You have red sticks, green sticks, and blue stick. If you're further provided with extra blue sticks, you can achieve the task. Let alone, other methods are allowed as well; you can also be provided with extra red sticks and blue stick to achieve the game. However you perform, the answer is .
30 30 30
0
You have red sticks, green sticks, and blue sticks. You can already create a non-degenerate triangle with given sticks. Hence the answer is .