olympiads / MatematickiTalent /md /en-european-cup /en-YGPd57jfQ06pIAQ_EmJMXA.md
LxYxvv's picture
add pdf files
802d9fe
|
Raw
History Blame
23.3 kB

PROBLEMS AND SOLUTIONS OF THE $12^{\mathrm{TH}}$ EUROPEAN MATHEMATICAL CUP
$9^{\text {th }}$ December 2023 - $17^{\text {th }}$ December 2023
Junior Category

Problems and Solutions

Problem 1. Suppose $a, b, c$ are positive integers such that

gcd(a,b)+gcd(a,c)+gcd(b,c)=b+c+2023 \operatorname{gcd}(a, b)+\operatorname{gcd}(a, c)+\operatorname{gcd}(b, c)=b+c+2023

Prove that $\operatorname{gcd}(b, c)=2023$.

Remark: For positive integers $x$ and $y, \operatorname{gcd}(x, y)$ denotes their greatest common divisor.

(Ivan Novak)

Solution. We want to prove $\operatorname{gcd}(a, b)=b$ and $\operatorname{gcd}(a, c)=c$, since then the equality from the problem statement implies $\operatorname{gcd}(b, c)=2023$.

1 point.

Note that $\operatorname{gcd}(a, b)$ is a divisor of $b$ and $\operatorname{gcd}(b, c)$ is a divisor of $c$, so we must have $\operatorname{gcd}(a, b)=\frac{b}{u}$ and $\operatorname{gcd}(a, c)=\frac{b}{v}$ for some positive integers $u, v$ and we have

bu+cv+gcd(b,c)=b+c+2023 \frac{b}{u}+\frac{c}{v}+\operatorname{gcd}(b, c)=b+c+2023

We want to prove $u=v=1$ so we need to eliminate other options. We do this by considering some cases.

1 point.

Case I. Both $u$ and $v$ are greater than 1 .

In this case, we have $\operatorname{gcd}(a, b) \leqslant \frac{b}{2}$ and $\operatorname{gcd}(a, c) \leqslant \frac{c}{2}$, so we must have $\operatorname{gcd}(b, c)>\frac{b+c}{2}$. However, $\operatorname{gcd}(b, c)$ is a divisor of $b$ and $c$ so it is not greater than any of them and thus can't exceed their average, so we get a contradiction.

4 points.

Case II. $u=1$ and $v>1$.

In this case, we have

b+cv+gcd(b,c)=b+c+2023 b+\frac{c}{v}+\operatorname{gcd}(b, c)=b+c+2023

which can be rewritten as

gcd(b,c)=c+2023cv \operatorname{gcd}(b, c)=c+2023-\frac{c}{v}

Since $c-\frac{c}{v} \geqslant \frac{c}{2}$, we have $\operatorname{gcd}(b, c) \geqslant \frac{c}{2}+2023$, so it is a divisor of $c$ greater than $\frac{c}{2}$. Thus, it must be equal to $c$, so we conclude that $c$ divides $b$. However, note that $b \mid a$ since $\operatorname{gcd}(a, b)=b$, so we have $c|b| a$ which implies $c \mid a$. But then $\operatorname{gcd}(a, c)=c$, i.e. $v=1$, a contradiction.

Case III. $u>1$ and $v=1$.

This case is analogous to Case II, so we don't need to consider it.

4 points.

Notes on marking:

  • The points are all additive.

Problem 2. Let $n \geqslant 5$ be an integer. There are $n$ points in the plane, no three of them collinear. Each day, Tom erases one of the points, until there are three points left. On the $i$-th day, for $1 \leqslant i \leqslant n-3$, before erasing that day's point, Tom writes down the positive integer $v(i)$ such that the convex hull of the points at that moment has $v(i)$ vertices. Finally, he writes down $v(n-2)=3$. Find the greatest possible value that the expression

v(1)v(2)+v(2)v(3)++v(n3)v(n2) |v(1)-v(2)|+|v(2)-v(3)|+\ldots+|v(n-3)-v(n-2)|

can obtain among all possible initial configurations of $n$ points and all possible Tom's moves.

Remark. A convex hull of a finite set of points in the plane is the smallest convex polygon containing all the points of the set (inside it or on the boundary).

(Ivan Novak, Namik Agić)

Solution. The answer is $2 n-8$. The construction which achieves the bound is the following:

Take a semicircle $\Omega$ and mark $n-1$ points on it as $B_{1}, \ldots B_{n-1}$, in that order. Mark $A$ as the intersection of tangents to $\Omega$ at $B_{1}, B_{n-1}$ and consider $A$ and $B_{i}$ as $n$ starting points. In the first move, erase $A$, and after the first move erase $B_{i}$ in arbitrary order. It is easy to check that the first summand is $n-4$ and the remaining $n-4$ summands are 1 , giving the desired bound.

3 points.

The proof of the bound is as follows:

The key idea is to look at the contributions of the individual vertices to the sum. We will prove that each vertex $X$ has a contribution at most 2 to the sum. This is more or less immediate, the first possible contribution is when it becomes a vertex on a convex hull, and a second possible contribution is when it is erased from the hull (The sums after and before these 2 events are not affected by $X$, as well as between). Moreover, the points on an initial hull lose 1 possible contribution, and points of the final hull lose 1 possible contribution (consequence of the possibilities for contribution of a vertex).

3 points.

Let $z=v(1)$. From this we get an upper bound in contributions $2 n-z-3$ (Trivially, $z$ is at least 3 ), Now we split into 2 cases to further sharpen this:

1 point.

  • If there exists an index $i$ such that $v(i)<v(i+1)$, let $A$ be the erased vertex and let $B_{1}, \ldots B_{k}$ be the new vertices on the hull. The contributions from $A$ and $B_{i}$ for some $i$ (WLOG say $i=1$ ) cancel out, bringing the total bound of contributions to $2 n-3-3-2=2 n-8$.

2 points.

  • If there is no such $i$, we get the bound of $n-3($ as $v(i+1) \geqslant v(i)-1)$, and because $n \geqslant 5$, we also get an upper bound of $2 n-8 \geqslant n-3$.

1 point.

In both cases we obtain the desired upper bound and the proof is complete.

Notes on marking:

  • If a solution does not discuss the case where $v(i)$ is strictly decreasing (i.e. misses the discussion as in second bullet point), 1 point should be deducted.

Problem 3. Consider an acute-angled triangle $A B C$ with $|A B|<|A C|$. Let $M$ and $N$ be the midpoints of segments $\overline{B C}$ and $\overline{A B}$, respectively. The circle with diameter $\overline{A B}$ intersects the lines $B C, A M$ and $A C$ at $D$, $E$, and $F$, respectively. Let $G$ be the midpoint of $\overline{F C}$. Prove that the lines $N F, D E$ and $G M$ are concurrent.

(Michal Pecho)

Solution. Let $A^{\prime}$ be the reflection of $A$ across $M$, and let $F^{\prime}$ be the reflection of $F$ across $N$. Easy angle chase gives that $D$ and $F$ are feet of altitudes from $A, B$ respectively.

1 point.

First, $\angle D C A^{\prime}=\angle A B C=\angle D E A^{\prime}$, meaning that $D E C A^{\prime}$ is cyclic. As $N F=N A, F B|A C| B A^{\prime}$, which gives $F, B, A^{\prime}$ collinear. Now we have $\angle F^{\prime} F A=\angle B A C=\angle C A^{\prime} B=\angle C A^{\prime} F$, which yields $F^{\prime} F C A^{\prime}$ cyclic. $=1$

$3+3$ point.

From the radical center theorem on $(B D E F A),\left(D E C A^{\prime}\right),\left(F^{\prime} F C A^{\prime}\right)$ we know that $C A^{\prime}, F F^{\prime}, D E$ are concurrent. Let $Z$ be the point of concurrency.

2 points.

As $\angle F^{\prime} F C=\angle F C A^{\prime}$, we get that $\angle Z F C=\angle Z C F$, i.e. $Z$ lies on the perpendicular bisector of $F C$. But this bisector is exactly $G M$ (as $M F=M C$ and $G F=G C$ ). Finally, $Z$ also lies on $G M$ and the three lines from the statement are indeed concurrent at $Z$

1 point.

Notes on marking:

  • There is a projective approach to the problem, sketched in a marking scheme. Other computational methods seem hard to execute. For partial non-synthetic solutions, only the parts which are geometric interpretations will be awarded points.
  • If the solution marks the additional points as in the above, points will be given only for obtaining useful results, not solely on marking them.

Problem 4. We say a 2023-tuple of nonnegative integers $\left(a_{1}, a_{2}, \ldots a_{2023}\right)$ is sweet if the following conditions hold:

  • $a_{1}+a_{2}+\ldots+a_{2023}=2023$,
  • $\frac{a_{1}}{2^{1}}+\frac{a_{2}}{2^{2}}+\ldots+\frac{a_{2023}}{2^{2023}} \leqslant 1$.

Determine the greatest positive integer $L$ such that

a1+2a2++2023a2023L a_{1}+2 a_{2}+\ldots+2023 a_{2023} \geqslant L

holds for every sweet 2023-tuple $\left(a_{1}, a_{2}, \ldots, a_{2023}\right)$.

(Ivan Novak)

Solution. Let $a_{1}, a_{2}, \ldots$ be a sweet sequence for which the least value $L$ of $a_{1}+2 a_{2}+3 a_{3}+\ldots$ is achieved.

Suppose that there are two nonconsecutive indices $i<k$ with $a_{i}, a_{k}>0$.

Consider the sequence

(a1,a2,,ai1,ai1,ai+1+2,ai+2,,ak1,ak1,ak+1,) \left(a_{1}, a_{2}, \ldots, a_{i-1}, a_{i}-1, a_{i+1}+2, a_{i+2}, \ldots, a_{k-1}, a_{k}-1, a_{k+1}, \ldots\right)

i.e. the sequence in which the $i$-th and $k$-th term are reduced by 1 and the $i+1$-th term is increased by 2 .

We claim that this sequence is also sweet and that it achieves the value not greater than $L$.

The sum of its elements is unchanged so the first condition is satisfied.

For the second condition, note that

ai12i+ai+1+22i+1+ak12k=ai2i+ai+12i+1+ak2k12k \frac{a_{i}-1}{2^{i}}+\frac{a_{i+1}+2}{2^{i+1}}+\frac{a_{k}-1}{2^{k}}=\frac{a_{i}}{2^{i}}+\frac{a_{i+1}}{2^{i+1}}+\frac{a_{k}}{2^{k}}-\frac{1}{2^{k}}

so the sum in the second condition decreases, so it remains smaller than 1 .

Finally, we claim that the value of the sum we're minimising didn't increase. Indeed, we have

i(ai1)+(i+1)(ai+1+2)+k(ak1)=iai+(i+1)ai+1+kak(ki2) i\left(a_{i}-1\right)+(i+1)\left(a_{i+1}+2\right)+k\left(a_{k}-1\right)=i a_{i}+(i+1) a_{i+1}+k a_{k}-(k-i-2)

and since $k \geqslant i+2$, this means the sum didn't increase.

Repeating this transformation finitely many times, we obtain a sequence which obtains the minimum and which doesn't have two nonconsecutive indices $i<k$ with $a_{i}, a_{k}>0$. Thus, it suffices to check sequences of the form

(0,0,,0,a,b,0,0,) (0,0, \ldots, 0, a, b, 0,0, \ldots)

with $i-1$ leading zeroes for some positive integer $i$, and with $a>0, b \geqslant 0$.

6 points.

In this case, we have the conditions

a+b=20232a+b2i+1 \begin{array}{r} a+b=2023 \\ 2 a+b \leqslant 2^{i+1} \end{array}

and we're minimising the expression

f(a,b,i)=ia+(i+1)b=2023i+b f(a, b, i)=i a+(i+1) b=2023 i+b

Since $0 \leqslant b<2023$, the optimal value of $i$ is the least one for which the two conditions can be satisfied. We must have $2^{i+1}=2 a+b>2023$, which holds if and only if $i+1 \geqslant 11$, i.e. we must check $i=10$.

3 points.

When $i=10$, we have $a+b=2023,2 a+b \leqslant 2048$, which gives $b \geqslant 1998$, or

10a+11b20230+1998=22228 10 a+11 b \geqslant 20230+1998=22228

This value can be obtained for $a=25$ and $b=1998$, so we conclude that $L=22228$.

1 point.

Notes on marking:

  • In the first part worth 6 points, 2 points will be awarded if the solution states that we can WLOG have equality in (2).
  • Failed attempts of smoothing the sequence will be worth points depending on how close is it to the correct one (1 or 2 points). If it also contains first remark, the total sum is $1+\mathrm{pts}$ on smoothing (not completely additive with smoothing)

PROBLEMS AND SOLUTIONS OF THE $12^{\mathrm{TH}}$ EUROPEAN MATHEMATICAL CUP $9^{\text {th }}$ December 2023 - $17^{\text {th }}$ December 2023

Senior Category

Problems and Solutions

Problem 1. Determine all sets of real numbers $S$ such that:

  • 1 is the smallest element of $S$,
  • for all $x, y \in S$ such that $x>y, \sqrt{x^{2}-y^{2}} \in S$.

(Adian Anibal Santos Sepčić)

Solution. All such sets are the set $\sqrt{\mathbb{N}}={\sqrt{n} \mid n \in \mathbb{N}}$ and the sets $\sqrt{[n]}={\sqrt{k} \mid k \leqslant n, k \in \mathbb{N}}$ for any $n \in \mathbb{N}$. It's easy to check that all such sets satisfy the problem's condition.

1 point.

We will now show that any $S$ that satisfies the two conditions of the problem is of this form. It suffices to show that $S$ can only contain square roots of positive integers and that $\sqrt{n} \in S$ implies that $\sqrt{m} \in S$ for any $m \leqslant n$.

First, note that we have $1 \in S$ so for any $x \in S$ with $x>1$ we have $\sqrt{x^{2}-1} \in S$. Repeated application of this gives that $\sqrt{x^{2}-n} \in S$ for any $n \in \mathbb{N}$ such that $n<x^{2}$.

3 points.

Now, assume that some number $x \in S$ is not the square root of an integer. We then immediately have $0<x^{2}-\left\lfloor x^{2}\right\rfloor<1$ as $x^{2}$ is not an integer, and the above consideration gives that $\sqrt{x^{2}-\left\lfloor x^{2}\right\rfloor} \in S$ and is strictly less than 1 , which is a contradiction with $1=\min (S)$. Therefore, we conclude that any element of $S$ has to be the square root of an integer.

5 points.

Now, take some $\sqrt{n} \in S$. The above consideration immediately gives $\sqrt{n-1} \in S$ and we can conclude by induction that any smaller square root of an integer must also be a member of $S$, and we are done.

1 point.

Notes on marking:

  • Any proof that shows that the members of $S$ must necessarily be square roots of positive integers is worth 8 points. Of the other 2 points, one is assigned for correctly and completely writing the solution set, and one for noting that if $\sqrt{n} \in S$, then all smaller square roots $\sqrt{m}$ must also be in $S$. This must be explicitly commented on.

Problem 2. Let $A B C$ be a triangle such that $\angle B A C=90^{\circ}$. The incircle of triangle $A B C$ is tangent to the sides $\overline{B C}, \overline{C A}, \overline{A B}$ at $D, E, F$ respectively. Let $M$ be the midpoint of $\overline{E F}$. Let $P$ be the projection of $A$ onto $B C$ and let $K$ be the intersection of $M P$ and $A D$. Prove that the circumcircles of triangles $A F E$ and $P D K$ have equal radius.

(Kyprianos-Iason Prodromidis)

First Solution. Let $S=E F \cap B C$, and let $I$ be the center of the incircle of $\triangle A B C$ and let $H$ be the orthocenter of $\triangle D E F$. Easy angle chase shows $\angle F D E=45^{\circ}$, and hence we have $D H=E F$ (both being equal to $\frac{\sqrt{2}}{2}$ times the radius of the incircle of $\triangle A B C$ ). Also, as $D I A H$ is a parallelogram, $A H \perp B C$ and $D H \perp E F$ which give $A H P$ collinear. Our goal is to show $D K H P$ cyclic, because then diameters of the circles in question would be $D H$ and $E F$ respectively (latter because $H P \perp D P$ ), which we showed are equal.

3 points.

The main claim is the following: $I S \perp A D$ (This holds regardless of the right angle). One can prove it either via complex numbers (setting ( $D E F)$ as the unit circle) or by showing that $A D$ is a polar of $S$ with respect to the incircle of $\triangle A B C$. We will omit the proofs because the lemma is well-known.

Also, $A M P S$ is cyclic because of the right angles at $M, P$

2 points.

Now we have:

HPK=APM=ASM=ISM \angle H P K=\angle A P M=\angle A S M=\angle I S M

where the second equality follows from the $A M P S$ being cyclic, the third equality follows from $A E I F$ being a square, i.e. $I$ is the reflection of $A$ across $E F$.

2 points.

Using the lemma we have:

ISM=DAM=KAM=HDK \angle I S M=\angle D A M=\angle K A M=\angle H D K

where the first equality holds because $I S \perp A D$ and $S M \perp A M$, and the last equality follows from $D H | A M$.

2 points.

These 2 chains of equality show $\angle H P K=\angle H D K$, which exactly means $H P D K$ is cyclic, and we conclude from the first paragraph.

1 point.

Second Solution. Let $I$ be the circumcircle of $D E F$, notice that $A E F I$ is a square. Let $B C, E F$ meet at $S$. It is clear that $A M K S$ is cyclic. Also $A$ lies on the $D$-symmedian so since $I S \perp A D$, if $I S, A D$ intersect at $X$, this point lies on the circumcircles of $I E F, A M K$.

3 points.

Let circles of $D K L, A M K$ intersect at $Y$, it follows that $\angle D L K=\angle D Y K$. But, $\angle D L K=\angle K T D+\angle M S A=$ $90^{\circ}-\angle S D A+\angle M S A=\angle D S M=\angle M Y K$. It follows that $Y$ is on $D M$.

2 points.

Now, we shall show that the feet of $E$ and $F$ on $D F$ and $D E$, respectively lie on the circle of $D K L$. By the theorem of radical axis, if circles $F M Y, E A F$ meet at $Z$, then $Z$ would be on $D F$. We also have $\angle E Z F=90^{\circ}$, since $\angle E A F=90^{\circ}$. Analogously, if the circles of $E M Y, E A F$ meet at $W$, we can generate a similar result. Thus, the circles of $D K L, D Z W$ would be the same, i.e., identical. If $H$ is the orthocenter of $D E F$, we have $R_{D K L}=R_{D Z W}=\frac{D H}{2}=\frac{I A}{2}=R_{A E F}$, as desired.

5 points.

Notes on marking:

  • Citing the lemma as well-known won't cause point loss.
  • In all incomplete computational solutions, only the geometric facts derived from the calculations will be worth points.

Problem 3. Let $n$ be a positive integer. Let $B_{n}$ be the set of all binary strings of length $n$. For a binary string $s_{1} s_{2} \ldots s_{n}$, we define its twist in the following way. First, we count how many blocks of consecutive digits it has. Denote this number by $b$. Then, we replace $s_{b}$ with $1-s_{b}$. A string $a$ is said to be a descendant of $b$ if $a$ can be obtained from $b$ through a finite number of twists. A subset of $B_{n}$ is called divided if no two of its members have a common descendant. Find the largest possible cardinality of a divided subset of $B_{n}$.

(Viktor Simjanoski)

Solution. For a string $s$, denote its twist by $f(s)$, and the number of blocks of consecutive digits it has by $b(s)$. Construct an undirected graph $G$ on $B_{n}$ with edges $(s, f(s))$ for all $s \in B_{n}$, and note that the largest possible cardinality of a divided subset of $B_{n}$ is the number of connected components of the graph.

Each connected component of $G$ contains exactly one cycle, and we aim to show that each cycle in the graph has a length of exactly 2 .

1 point.

Assume that there exists a cycle $A \subseteq B_{n}$ which is not of length 2 . First, fix some $s \in A$.

We wish to show that $1<b(s)<n$. If we have $b(s)=1$, then $s$ is either the string with all ones or the string with all zeroes, and we can easily see that $f(s)=f^{3}(s)$ and $s \neq f(f(s))$, which contradicts $s \in A$. Similarly, if $b(s)=n$ then $s$ is one of the two alternating strings and we arrive to the same conclusion.

1 point.

Now consider $x=s_{b(s)-1}, y=s_{b(s)}, z=s_{b(s)+1}$. A twist replaces $y$ with $1-y$, and depending on $x, z$ changes $b(s)$ in the following ways:

  • if $x=z \neq y$, we have $b(f(s))=b(s)-2$.
  • if $x=y=z$, we have $b(f(s))=b(s)+2$.
  • if $x \neq y=z$ or $x=y \neq z$, we have $b(f(s))=b(s)$ and moreover we see that $f(f(s))=s$ and the connected component of $s$ has a cycle of length 2 so $s \notin A$.

We therefore see that if $s \in A$, we have $b(f(s))=b(s) \pm 2$.

1 point.

Now, consider some $s \in A$. We then have $f^{k}(s)=s$ for some $k \in \mathbb{N}$. Take $s$ such that $b(s) \geqslant b\left(f^{m}(s)\right)$ for any $1 \leqslant m<k$, i.e. the element of the cycle with the largest number of blocks.

We have $b(f(s))=b(s)-2=b\left(f^{-1}(s)\right)$ by maximality and the previous proof. Notice that the application of $f$ only changes the positions in $s$ which are of the same parity as $b(s)$. We can see (as $b(s)=b\left(f^{-1}(s)\right)+2$ that $s_{b(s)-3}=$ $s_{b(s)-1} \neq s_{b(s)-2}$ and by similar reasoning $s_{b(s)-1}=s_{b(s)+1} \neq s_{b(s)}$.

1 point.

Now, consider the least $t>0$ such that $b\left(f^{t}(s)\right)=b(s)$. By minimality of $t$, it follows that $f^{t}(s){b(s)}=1-s{b(s)}$ but as we have $s_{b(s)+1}=1-s_{b(s)}=s_{b(s)-1}$ we obtain that $b\left(f\left(f^{t}(s)\right)\right)=b(s)+2$ which contradicts the maximality of $b(s)$ in $A$, so no such component $A$ can exist.

4 points.

Now, let us count the possible cycles of length 2. Each cycle of length 2 occurs when we have $f(f(s))=s$ and $b(s)=$ $b(f(s))$, which gives $2 \leqslant b(s) \leqslant n-1$.

We count by fixing either the left or right of the position $b(s)=k$ in a string $s$ as one of $k-1$ "break" points between $0 / 1$ blocks in the string $s$ and then counting that the other $k-2$ block "breakpoints" can be assigned in $\binom{n-3}{k-2}$ ways to the remaining $n-3$ spots between two symbols of $s$, with each assignment of blocks giving two distinct outcomes due to the choice of $0 / 1$ in the starting block. This gives a total of

k=2n12(n3k2)=2n2 \sum_{k=2}^{n-1} 2\binom{n-3}{k-2}=2^{n-2}

different cycles of length 2 and we are done.

Problem 4. Let $f: \mathbb{N} \rightarrow \mathbb{N}$ be a function such that for all positive integers $x$ and $y$, the number $f(x)+y$ is a perfect square if and only if $x+f(y)$ is a perfect square. Prove that $f$ is injective.

Remark. A function $f: \mathbb{N} \rightarrow \mathbb{N}$ is injective if for all pairs $(x, y)$ of distinct positive integers, $f(x) \neq f(y)$ holds.

(Ivan Novak)

Solution. Suppose for the sake of contradiction that there exist positive integers $a, b$ and $c$ such that $f(a)=f(b)=c$ and $a>b$. Consider any $x>\sqrt{c}$.

Then, since $x^{2}-c+c=x^{2}-c+f(a)=x^{2}-c+f(b)$ is a square, both $f\left(x^{2}-c\right)+a$ and $f\left(x^{2}-c\right)+b$ are squares. Since $a-b>0$, we have the following bound:

ab=(f(x2c)+a)(f(x2c)+b)>f(x2c)+a+f(x2c)+b a-b=\left(f\left(x^{2}-c\right)+a\right)-\left(f\left(x^{2}-c\right)+b\right)>\sqrt{f\left(x^{2}-c\right)+a}+\sqrt{f\left(x^{2}-c\right)+b}

This implies that the function $x \mapsto f\left(x^{2}-c\right)$ obtains only finitely many values since otherwise the bound wouldn't hold. By the pigeonhole principle, the expression $f\left(x^{2}-c\right)$ obtains some fixed value $m$ for infinitely many positive integers $x$.

1 point.

Consider a positive integer $y>\sqrt{m}$. Then $y^{2}-m+f\left(x^{2}-c\right)=y^{2}$ for infinitely many values of $x$. This implies that $f\left(y^{2}-m\right)+x^{2}-c$ is a square for infinitely many values of $x$. This implies $f\left(y^{2}-m\right)-c=0$, since it can be written as a difference of squares in infinitely many ways. Thus, $f\left(y^{2}-m\right)=c$ for every $y>\sqrt{m}$.

1 point.

Now, $f\left(y^{2}-m\right)=c$ for infinitely many $y$, so with the same argumentation as above we get $f\left(x^{2}-c\right)=m$ for every $x>\sqrt{c}$.

Lemma. There exists a positive integer $M$ such that for every positive integer $z$ we have $f(z) \leqslant M$ or $f(z) \equiv m+2$ $(\bmod 4)$

Proof. If $z=x^{2}-c$ for some positive integer $x$ then we have $f(z)=m$.

Now assume $z \neq x^{2}-c$ for all positive integers $x$.

Let $y \in \mathbb{N}, y>\sqrt{m}$. If $f(z)+y^{2}-m$ is a square, then $z+f\left(y^{2}-m\right)$ is a square, but $f\left(y^{2}-m\right)=c$, so this is contradiction with the choice of $z$.

So $f(z)+y^{2}-m \neq x^{2}$ for all positive integers $x$.

From this, we have $f(z) \neq x^{2}-y^{2}+m$ for all positive integers $x$ i $y$ such that $y>\sqrt{m}$.

Let $y_{1}$ be the smallest positive integer such that $y_{1}>\sqrt{m}$.

For every $y \geqslant y_{1}$ we have $f(z) \neq(y+1)^{2}-y^{2}+m=2 y+1+m$, so $f(z)$ is either smaller than $2 y_{1}+1+m$ or $f(z)-m \not \equiv 1$ $(\bmod 2)$.

For every $y \geqslant y_{1}$ we have $f(z) \neq(y+2)^{2}-y^{2}+m=4 y+4+m$, so $f(z)$ is either smaller than $4 y_{1}+4+m$ or $f(z)-m \not \equiv 0$ $(\bmod 4)$.

Now $M=4 y_{1}+4+m$ satisfies the claim of the lemma.

5 points.

Take $M$ which satisfies the lemma. Now take $w$ such that $w+1, w+2, \ldots, w+M$ are not squares, and $w+m \equiv 0$ (mod 4). For some $d>\sqrt{f(w)}$

we have $d^{2}-f(w)+f(w)$ is a square so $f\left(d^{2}-f(w)\right)+w$ must be a square, but using the lemma on $z=d^{2}-f(w)$ we get that $f\left(d^{2}-f(w)\right)+w$ is either among $w+1, w+2, \ldots, w+M$ or congruent $2+m+w \equiv 2$ modulo 4 , so it cannot be a square.

Contradiction with the starting assumption, so $f$ must be injective.