RightTriangle
From TopCoder. Right triangles on circle points. Solve the geometry problem "RightTriangle".
Examples
Input: [1,2,3]
Output: 0
Input: [2,3,4]
Output: 0
Hints
Thales' theorem: a triangle inscribed in a circle is right-angled iff one side is a diameter. Count how many distinct diameters the N equally-spaced points define.
A diameter connects point `i` to point `(i + N/2) mod N`, which exists only when N is even. For each diameter, any of the remaining N-2 points can serve as the right-angle vertex.
If N is odd, no two points are exact opposites, so zero right triangles exist. For even N, the total count is `(N/2) × (N-2)`. Ensure no double-counting — each triangle has exactly one hypotenuse.
RightTriangle
**From TopCoder.** Right triangles on circle points. Solve the geometry problem "RightTriangle".