Time limit
2s
Memory limit
128 MB
There are N distinct points on a two-dimensional plane. Choose three of them and count how many choices form a right triangle whose side lengths are exactly A, B, and C.
The lengths satisfy A < B < C and C^2 = A^2 + B^2, so A and B are the two perpendicular sides. Each set of three points is counted once.
The first line contains four integers N, A, B, and C: the number of points and the three side lengths of the right triangle.
Each of the next N lines contains two integers x and y, the coordinates of one point.
Print the number of valid choices of three points.