Task B-1.5. Marko and his "band" set off on a tour. On the first day, they headed east, on the second day, they continued north, on the third day, they continued west, on the fourth day, they headed south, on the fifth day, they headed east, and so on. If on the n-th day of the tour they walked $\frac{n^{2}}{2}$ kilometers, how many km were they from the starting point at the end of the fortieth day?
## Solution.

Let the starting point be the origin. The movement and position of the first few days of the tournament are determined by the points $A_{1}, A_{2}, A_{3}, \ldots$

| $n$ (day) | 1. | 2. | 3. | 4. | 5. | 6. | 7. | 8. | $\ldots$ | 39. | 40. |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| $\mathrm{km}$ | $\frac{1}{2}$ | ![](https://cdn.mathpix.com/cropped/2024_05_30_6bd7d8198e5de61c26bbg-04.jpg?height=53&width=52&top_left_y=2550&top_left_x=792) | $\frac{3^{2}}{2}$ | $\frac{4^{2}}{2}$ | $\frac{55^{2}}{2}$ | $\frac{6^{2}}{2}$ | $\frac{7^{2}}{2}$ | ![](https://cdn.mathpix.com/cropped/2024_05_30_6bd7d8198e5de61c26bbg-04.jpg?height=53&width=57&top_left_y=2550&top_left_x=1267) | $\ldots$ | $\frac{39^{2}}{2}$ | $\frac{40^{2}}{2}$ |
| Direction | N | S | W | E | N | S | W | E | $\ldots$ | W | E |
| Quadrant | x-axis | 1 | 2 | 3 | 4 | 1 | 2 | 3 | 4 | $\ldots$ | 2 | 3 |

![](https://cdn.mathpix.com/cropped/2024_05_30_6bd7d8198e5de61c26bbg-04.jpg?height=824&width=1613&top_left_y=1588&top_left_x=229)

We conclude that on the 40th day, Mark's position will be in the third quadrant at point $A_{40}(x, y)$. Specifically,

$$
\begin{aligned}
x & =\frac{1^{2}}{2}-\frac{3^{2}}{2}+\frac{5^{2}}{2}-\frac{7^{2}}{2}+\ldots+\frac{37^{2}}{2}-\frac{39^{2}}{2}= \\
& =\frac{1}{2}((1-3)(1+3)+(5-7)(5+7)+\ldots+(37-39)(37+39))= \\
& =-1(1+3+\ldots+37+39)=\frac{-(1+39) \cdot 20}{2}=-400 \\
y & =\frac{2^{2}}{2}-\frac{4^{2}}{2}+\frac{6^{2}}{2}-\frac{8^{2}}{2}+\ldots+\frac{38^{2}}{2}-\frac{40^{2}}{2}= \\
& =\frac{1}{2}((2-4)(2+4)+(6-8)(6+8)+\ldots+(38-40)(38+40))= \\
& =-1(2+4+\ldots+38+40)=\frac{-(2+40) \cdot 20}{2}=-420
\end{aligned}
$$

The distance from Mark to the starting point is equal to the distance of point $A_{40}$ from the origin and is

$$
d=\sqrt{400^{2}+420^{2}}=580
$$

The required distance is $580 \mathrm{~km}$.

## NATIONAL MATHEMATICS COMPETITION

## 2nd grade - high school - B variant

Šibenik, April 3, 2014.

IF A STUDENT HAS A DIFFERENT APPROACH TO SOLVING THE PROBLEM, THE COMMITTEE IS OBLIGED TO EVALUATE THAT APPROACH APPROPRIATELY.