#P1355C. Count Triangles
Count Triangles
No submission language available for this problem.
Description
Like any unknown mathematician, Yuri has favourite numbers: , , , and , where . Yuri also likes triangles and once he thought: how many non-degenerate triangles with integer sides , , and exist, such that holds?
Yuri is preparing problems for a new contest now, so he is very busy. That's why he asked you to calculate the number of triangles with described property.
The triangle is called non-degenerate if and only if its vertices are not collinear.
The first line contains four integers: , , and () — Yuri's favourite numbers.
Print the number of non-degenerate triangles with integer sides , , and such that the inequality holds.
Input
The first line contains four integers: , , and () — Yuri's favourite numbers.
Output
Print the number of non-degenerate triangles with integer sides , , and such that the inequality holds.
Samples
Note
In the first example Yuri can make up triangles with sides , , and .
In the second example Yuri can make up triangles with sides , and .
In the third example Yuri can make up only one equilateral triangle with sides equal to .