Let $k$ be a positive integer. Find all positive integers $n$, such that it is possible to mark $n$ points on the sides of a triangle (different from its vertices) and connect some of them with a line in such a way that the following conditions are satisfied: 1) there is at least $1$ marked point on each side, 2) for each pair of points $X$ and $Y$ marked on different sides, on the third side there exist exactly $k$ marked points which are connected to both $X$ and $Y$ and exactly k points which are connected to neither $X$ nor $Y$
Problem
Source: Estonia IMO TST 2018 p11 / modified version of Croatia MO 2017
Tags: combinatorics, combinatorial geometry, points