题库练习 Make a triangle!
← 上一题 下一题 →

A12073 | Make a triangle!

时间限制1s
内存限制256MB
通过 / 提交0/0

题目描述

Masha has three sticks of length $a$ , $b$ and $c$ centimeters respectively. In one minute Masha can pick one arbitrary stick and increase its length by one centimeter. She is not allowed to break sticks.

What is the minimum number of minutes she needs to spend increasing the stick's length in order to be able to assemble a triangle of positive area. Sticks should be used as triangle's sides (one stick for one side) and their endpoints should be located at triangle's vertices.

输入格式

The only line contains tree integers $a$ , $b$ and $c$ ( $1 \leq a, b, c \leq 100$ ) — the lengths of sticks Masha possesses.

输出格式

Print a single integer — the minimum number of minutes that Masha needs to spend in order to be able to make the triangle of positive area from her sticks.

输入输出样例

输入 #1
3 4 5
输出 #1
0
输入 #2
2 5 3
输出 #2
1
输入 #3
100 10 10
输出 #3
81
C++ 编辑器
输入
输出