## Task A-1.5.

Andrija and Boris have 2014 cards labeled with numbers from 1 to 2014. Andrija has all the cards with even numbers, and Boris has all the cards with odd numbers. Andrija has arranged his cards in a circle in order, from 2 to 2014, in a clockwise direction so that the numbers on the cards are not visible. Boris knows that the cards are arranged in this order and direction, but he does not know where the card with the number 2 is. After that, Boris places one of his cards on each of Andrija's cards, thus forming 1007 pairs of cards. For each pair, the numbers on the cards are compared, and one point is awarded to the player whose card has the higher number.

Determine the largest possible $N$ such that Boris can be sure to score at least $N$ points.
## Solution.

The highest number of points Boris can be sure to achieve is 503.

We claim that if Boris arranges his cards in reverse order, from 2013 to 1, in the direction of the clock, then regardless of Andrija's arrangement, Boris will achieve 503 points.

![](https://cdn.mathpix.com/cropped/2024_05_30_1032c7d9e342fcdfefb0g-04.jpg?height=314&width=1602&top_left_y=2319&top_left_x=224)

For such a Boris's arrangement, consider some Andrija's arrangement. Below Boris's card 2013 lies Andrija's card $2k$, for some $k \in \mathbb{N}$. Assume that $2k \neq 2014$, the case where $2k = 2014$ follows directly. The arrangement of the cards is written in a sequence, starting from the position where Boris placed the card 2013. We divide the pairs of cards into two parts: the part where Andrija's cards are $2k, 2k+2, \ldots, 2012, 2014$, and the second part where they are $2, 4, \ldots, 2k-4, 2k-2$. In the first part, Andrija's cards (from left to right) increase from $2k$ to 2014, while Boris's decrease from 2013. In other words, at the beginning of this part, Boris's cards are larger, and at the end, Andrija's are larger. Let $2a+1 (a \in \mathbb{N})$ be the last Boris's card in the first part that is larger than the corresponding Andrija's card, denoted by $2b$ for some $b \in \mathbb{N}$. Thus, we have

$$
2a+1 > 2b, \quad 2a-1 < 2b+2
$$

From the above inequalities, it follows that $2a-3 < 2b < 2a+1$, so $2b = 2a-2$ or $2b = 2a$. Note that the sum of the cards in each pair of the first part is equal and is $2013 + 2k$. Indeed, in each subsequent pair, Boris's number is 2 less than the previous one, and Andrija's is 2 more than the previous one, so the sum does not change. Therefore, $(2a+1) + 2b = 2013 + 2k$.

If $2b = 2a-2$, then $k$ is an odd number and $a = \frac{1007 + k}{2}$. Similarly, if $2b = 2a$, then $k$ is an even number and $a = \frac{1006 + k}{2}$. If $X$ is the number of pairs in the first part where Boris's card is larger than Andrija's, then $X = b - k + 1$. Therefore, we conclude that

$$
X = \begin{cases}
\frac{1007 - k}{2}, & \text{if } k \text{ is odd} \\
\frac{1008 - k}{2}, & \text{if } k \text{ is even}
\end{cases}
$$

Next, let $Y$ be the number of pairs in the second part where Boris's card is larger than Andrija's. By analogous reasoning as in the first part, we get

$$
Y = \begin{cases}
\frac{k - 1}{2}, & \text{if } k \text{ is odd} \\
\frac{k - 2}{2}, & \text{if } k \text{ is even}
\end{cases}
$$

Thus, $X + Y = 503$ regardless of the value of $k$, and we conclude that by arranging the cards in this way, Boris will achieve 503 points.

It remains to prove that Boris cannot arrange his cards in such a way that his number of points is greater than 503 regardless of Andrija's arrangement.

Assume that there exists a Boris's arrangement for which Andrija achieves fewer than 504 points regardless of how he places his cards. For such a Boris's arrangement, let $A$ be the total number of points Andrija achieves in all his possible arrangements. There are 1007 possible Andrija's arrangements, so by assumption, we have $A < 1007 \cdot 504$. On the other hand, consider how much each of Boris's cards contributes to the number $A$. The card with the number 2 contributes 1 point because it only gives points in the arrangement where the card with the number 1 is above it. The card with the number 4 contributes 2 points (cases where the cards 1 and 3 are above it). Generally, for $k \in \{1, 2, \ldots, 1007\}$, the card with the number $2k$ contributes $k$ points. Therefore, we have

$$
A = 1 + 2 + \cdots + 1007 = \frac{1007 \cdot 1008}{2} = 1007 \cdot 504
$$

We have reached a contradiction, so we conclude that our assumption was incorrect, i.e., Boris cannot be sure to achieve more than 503 points.

## NATIONAL MATHEMATICS COMPETITION

## 2nd grade - high school - A variant

Šibenik, April 3, 2014.