26.16. a) (Jury, SRV, 77). On the coordinate plane, $n \geqslant 3$ points with integer coordinates are marked such that any three of them form a triangle whose medians do not intersect at a point with integer coordinates. Find the largest number $n$ for which this is possible.

b) (Jury, SRR, 77). In space, 37 different points with integer coordinates are marked, no three of which lie on the same line. Prove that among them, one can choose 3 points such that the coordinates of the point of intersection of the medians of the triangle formed by them are integers.
26.16. a) If $\left(x_{1} ; y_{1}\right),\left(x_{2} ; y_{2}\right),\left(x_{3} ; y_{3}\right)$ are the coordinates of the vertices of a triangle, then the point of intersection of its medians has coordinates

$$
\left(\frac{x_{1}+x_{2}+x_{3}}{3} ; \frac{y_{1}+y_{2}+y_{3}}{3}\right)
$$

We will call a point $(x ; y)$ a point of type $(r_{1} ; r_{2})$ if $r_{1}, r_{2}$ are the remainders of the division by 3 of the numbers $x, y$ respectively. Eight points satisfying the condition of the problem exist. It is sufficient to take these points as follows: two points of type $(0 ; 0)$, two of type $(0 ; 1)$, two of type $(1 ; 0)$, and two of type $(1 ; 1)$. Moreover, no three of them should lie on the same line. These conditions are satisfied, for example, by the following points: $(0 ; 0),(0 ; 3),(3 ; 1),(3 ; 4),(1 ; 0),(4 ; 3),(1 ; 1),(7 ; 4)$. Suppose now that there exist 9 points satisfying the condition of the problem. We will divide these 9 points into groups of the same type. Then no group contains 3 points (otherwise they would form a triangle in which the medians intersect at an integer point). Therefore, there are at least five groups in total, and among our 9 points, there will be 5 points of different types. We will divide these 5 points into 3 groups depending on the remainder of the division by 3 of the first coordinate. No group contains 3 points (indeed, if such 3 points existed, they would have types $(r ; 0),(r ; 1),(r ; 2)$ for some $r$, and thus would form a triangle with an integer point of intersection of the medians). Therefore, in two of these groups, there are two points each, and in the third group, there is one point. Without loss of generality, we can assume that this one point has type $(0 ; 0)$. Then among our 5 points, there are no points of type $(0 ; 1)$ and $(0 ; 2)$. Moreover, among them, there cannot be two points of type $(1 ; 1)$ and $(2 ; 2)$ simultaneously (otherwise they, together with a point of type $(0 ; 0)$, would form a triangle in which the medians intersect at an integer point). For the same reason, among them, there cannot be two points of type $(1 ; 2)$ and $(2 ; 1)$, and two points of type $(1 ; 0)$ and $(2 ; 0)$. From this, we conclude that we have no more than four selected points. Contradiction.

b) To each integer point $(x ; y ; z)$, we will assign numbers $g(x), g(y), g(z)$ - the remainders of the division by 3 of the numbers $x, y, z$ respectively. Since the value of $g(x)$ takes no more than 3 values, at least 13 of the 37 considered points have the same value of $g(x)$ (otherwise, there would be no more than $12 \cdot 3 = 36$ points in total). Similarly, at least 5 of these 13 points have the same value of $g(y)$. The point of intersection of the medians of a triangle with vertices $\left(x_{1} ; y_{1} ; z_{1}\right),\left(x_{2} ; y_{2} ; z_{2}\right),\left(x_{3} ; y_{3} ; z_{3}\right)$ has coordinates

$$
x_{0}=\frac{x_{1}+x_{2}+x_{3}}{3}, \quad y_{0}=\frac{y_{1}+y_{2}+y_{3}}{3}, \quad z_{0}=\frac{z_{1}+z_{2}+z_{3}}{3}
$$

In this case, if $g\left(x_{1}\right)=g\left(x_{2}\right)=g\left(x_{3}\right)$ and $g\left(y_{1}\right)=g\left(y_{2}\right)=g\left(y_{3}\right)$, then the numbers $x_{0}$ and $y_{0}$ are integers, and the number $z_{0}$ is an integer if and only if $z_{1}+z_{2}+z_{3}=0(\bmod 3)$. In our case, 5 points are selected for which all the numbers $g(x)$ are equal and all the numbers $g(y)$ are equal. If among these points, there are three for which the numbers $g(z)$ take the values $0,1,2$, then for these points

$$
z_{1}+z_{2}+z_{3} \equiv g\left(z_{1}\right)+g\left(z_{2}\right)+g\left(z_{3}\right)=0+1+2 \equiv 0(\bmod 3) .
$$

If such points do not exist, then the numbers $g(z)$ for the selected 5 points take no more than 2 values, so there are 3 points in which the value of $g(z)$ is the same, and the corresponding number $z_{0}$ is an integer.