On the plane, $n$ points are given ($n>2$). No three of them are collinear. Through each two of them the line is drawn, and among the other given points, the one nearest to this line is marked (in each case this point occurred to be unique). What is the maximal possible number of marked points for each given $n$?

[i]Proposed by Boris Frenkin (Russia)[/i]
To solve this problem, we need to determine the maximum number of marked points for a given \( n \) points on a plane, where no three points are collinear. Let's denote this maximum number by \( f(n) \).

1. **Base Case \( n = 3 \)**:
   - For \( n = 3 \), any triangle formed by the three points will have each point marked when considering the lines formed by the other two points. Therefore, \( f(3) = 3 \).

2. **General Case \( n > 4 \)**:
   - Consider a slightly deformed regular polygon with \( n \) vertices. In such a configuration, each point can be the nearest to the line formed by any two other points. This gives us \( f(n) = n \) for \( n > 4 \).

3. **Special Cases \( n = 4 \)**:
   - For \( n = 4 \), we need to show that \( f(4) = 3 \). Suppose we have four points \( A, B, C, D \). Without loss of generality, assume that the triangle \( \triangle ABC \) has the smallest area among the four possible triangles formed by any three of the four points. Since the distances from a line to points are unique, the smallest area triangle is also unique. Therefore, point \( D \) cannot be the nearest to any line formed by the points \( A, B, C \). Hence, \( f(4) = 3 \).

4. **Constructive Approach for \( n = 3k, 3k+1, 3k+2 \)**:
   - For \( n = 3k \), we can consider \( k \) isolated triangles, each contributing 3 marked points, giving us \( f(3k) = 3k \).
   - For \( n = 3k+1 \), we can take \( k \) isolated triangles and one extra point very close to the joining line of two vertices from different triangles, giving us \( f(3k+1) = 3k+1 \).
   - For \( n = 3k+2 \), we can take \( k \) isolated triangles and two extra points forming a very small angle with one of the triangle vertices, giving us \( f(3k+2) = 3k+2 \).

Thus, the maximum number of marked points for each given \( n \) is \( f(n) = n \) for \( n > 4 \).

The final answer is \( \boxed{ f(n) = n } \) for \( n > 4 \), \( f(4) = 3 \), and \( f(3) = 3 \).