#P5864. [SEERC 2018] Broken Watch
[SEERC 2018] Broken Watch
Description
A UFO crashed on Earth. The alien captain survived, but his watch did not.
The alien watch is very similar to a human watch: it has a dial with a diameter of , and three hands with lengths , , and micrometers. However, aliens use different time units: one minute has seconds . Therefore, there are tick marks on the rim of the dial instead of .
The glass panel of the watch is broken, and the hands are loose: they can rotate freely and independently. Let the three hands point to any tick marks. Then the tips of the three hands can form a triangle (assuming the three hands are not collinear).
Before rescue arrives, the alien has nothing to do and thinks about the following problem: among all triangles formed in the way described above, how many triangles contain the center of the dial (denote the answer by )? (Triangles where the center lies on one side of the triangle should also be counted.)
Input Format
A single line contains integers , , , and , separated by one space.
Output Format
Output the value of .
15000 15000 15000 2
0
5000 10000 15000 3
6
15000 15000 15000 3
1
15000 15000 15000 4
4
15000 15000 15000 5
5
15000 15000 15000 6
14
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号