eolymp
bolt
Try our new interface for solving problems
Problems

Triangles

Triangles

\textbf{n} points are given on the plane with integer coordinates. No three points lie on one line. Find \textbf{k} - the number of triangles with vertices in these points and integer area. \InputFile The first line contains number \textbf{n}. Next \textbf{n} lines contain the pairs of integers - the points coordinates (\textbf{x_i}, \textbf{y_i}). It is known that \textbf{0} < \textbf{n}, |\textbf{x_i}|,|\textbf{y_i}| ≤ \textbf{5000}. \textbf{ Output} The value of \textbf{k}.
Time limit 0.1 seconds
Memory limit 64 MiB
Input example #1
5
2 -1
3 0
0 4
-3 0
-2 1
Output example #1
6