Problem 1. A diagram of a house consists of a square and an equilateral triangle of the same side length. What is the size of the marked angle in degrees?
Result. $105^{\circ}$
Solution. Note that the extra segment is a base of an isosceles triangle with angles $150^{\circ}, 15^{\circ}, 15^{\circ}$. The sought angle is $180^{\circ}-60^{\circ}-15^{\circ}=105^{\circ}$.
Problem 2. Members of a sport team are posing for a photo. They stand in a row and all of them are wearing team jerseys numbered by some distinct positive integers. The photographer notices that the one standing at the right end of the row has number 72 and that the number of any other team member divides the number of his neighbour on the right (the sides are given from the point of view of the photographer). How many athletes at most could be standing there?
Result. 6
Solution. Starting at the rightmost number 72 and moving left, the next number always equals the former one divided by a positive integer $n>1$. Since $72=2^{3} \cdot 3^{2}$ and with each step exponent of some prime decreases, hence we cannot have more than $1+3+2=6$ athletes. This is attained e.g. by the sequence $1,2,4,8,24,72$.
Problem 3. In an ensemble of string players, everyone can play the violin or the viola and exactly one quarter of all the members can play both the instruments. Furthermore, we know that 32 people can play the violin and 23 can play the viola. How many members are there altogether?
Result. 44
Solution. Let $n$ be the sought number of group members. When we add the counts 23 and 32, we obtain the total number of members, but with counting twice each member who can play both the instruments. Since there are $n / 4$ such members, we infer that
hence $n=44$.
Problem 4. Cecil has multiplied five consecutive positive integers, obtaining number $C$. David has done the same, but his sequence started with a number one greater than Cecil's, leading to the product $D$. What was the smallest of the numbers that David multiplied, provided that $C / D=4 / 5$ ?
Result. 21
Solution. Assume that $n$ is Cecil's first number, then $C=n(n+1)(n+2)(n+3)(n+4)$. David starts with $n+1$, so $D=(n+1)(n+2)(n+3)(n+4)(n+5)$. We have
Solving this equation for $n$ leads to $n=20$. Since we seek David's smallest number, the answer is 21 .
Problem 5. To each small triangle assign the number of small triangles with which it shares an edge. Determine the sum of all these numbers.
Result. 168
Solution. There are 18 boundary triangles with two neighbours and 3 triangles with just one neighbour. The remaining $64-18-3=43$ triangles have three neighbours and hence the result is $3 \cdot 43+2 \cdot 18+3=168$.
Problem 6. Find the largest positive integer $n$ such that $n^{2}-5 n+6$ is a prime number.
Result. 4
Solution. Since for any integer $n$ the number $n(n-5)$ is a product of odd and even numbers, we infer that $n^{2}-5 n+6=n(n-5)+6$ is even. Since the only even prime number is 2 , we get the equation $n^{2}-5 n+6=2$, the solutions of which are 1 and 4 . The sought largest integer is therefore 4 .
Another possible solution is to note directly that $n^{2}-5 n+6=(n-2)(n-3)$ can be a prime number only if one of the brackets equals $\pm 1$. Largest such number is 4 and the quadratic expression evaluated at 4 indeed yields the prime number 2 .
Problem 7. Two circles of radii 1 are touching in the centre of a big circle which is also tangent to the two smaller circles. Determine the length of the dashed segment, which is tangent to the smaller circles and its endpoints lie on the big circle as in the picture.
Result. $\quad 2 \sqrt{3} \doteq 3.46410$
Solution.
The dashed segment is located 1 unit above the horizontal diameter of the big circle. The centre of the big circle, one of the endpoints of the dashed segment and the point "on the top" of the big circle thus form an isosceles triangle with vertical base and one other side of length 2. The result is thus twice the length of an altitude in the equilateral triangle of side length 2 and can be computed e.g. by the Pythagorean theorem.
Problem 8. Four mathematicians sat around a table and have ordered a large bowl of pretzels. Daniel left for the toilet. Each minute, Adam, Beatha and Cyril took one pretzel, divided it into three equal pieces and ate it. After some time, Daniel returned to the table and they all continued eating one pretzel each minute, but Daniel got to eat $2 / 5$ of each pretzel, while the others got to eat $1 / 5$. After some time, Adam noted that Daniel ate exactly the same portion as himself. What is the ratio of time in which Daniel was absent to the time he was present?
Result. $3 / 5$
Solution. Let $t_{a}$ be the time for which Daniel was absent and $t_{p}$ the time for which he was present. Adam and Daniel ate the same amount of pretzels, so
Problem 9. An exchange office in Prague offers these coins: 1 Czech crown for 40 cents, 2 crowns for 50 cents, 5 crowns for 1 euro, 10 crowns for 2 euros, 20 crowns for 4.1 euros and 50 crowns for 9.9 euros. Mark wants to exchange all of his 11.8 euros, but he does not want to buy more than one coin of each type. How much will he get (in Czech crowns)? Find the sum of all solutions.
Result. 58
Solution. We have to solve the equation $11.8=0.4 \cdot x_{1}+0.5 \cdot x_{2}+1 \cdot x_{3}+2 \cdot x_{4}+4.1 \cdot x_{5}+9.9 \cdot x_{6}$ where all $x_{i}$ must be in the set ${0,1}$. Since $0.4+0.5+1+2+4.1<11.8$, we know that $x_{6}$ must be 1 . Therefore, the equation reads $1.9=0.4 \cdot x_{1}+0.5 \cdot x_{2}+1 \cdot x_{3}+2 \cdot x_{4}+4.1 \cdot x_{5}$. Since by choosing $x_{4}=1$ or $x_{5}=1$ the amount spent will exceed 11.8 euros, we need to set $x_{4}=x_{5}=0$. Because of $0.4+0.5+1=1.9$, the only solution is $x_{1}=x_{2}=x_{3}=x_{6}=1$ and $x_{5}=x_{4}=0$. Therefore, Mark will get $1+2+5+50=58$ Czech crowns.
Problem 10. In a regular grid of unit squares these fourteen points are marked. How many rectangles are there having four marked points as their vertices?
Result. 27
Solution. Seven types of rectangles can be found in the shown part of the grid:
There are 7 unit squares, 2 squares of size $2 \times 2,4$ squares like the one with dotted lines, and 2 like the one with dashed lines. In addition, there are 8 rectangles of size $1 \times 2,2$ rectangles of size $1 \times 3$, and 2 rectangles like the one with the dashed lines.
Altogether, we count $7+2+4+2+8+2+2=27$ rectangles.
Problem 11. What is the value of the positive integer $n$ for which the least common multiple of 60 and $n$ is larger by 777 than the greatest common divisor of 60 and $n$ ?
Result. 39
Solution. We wish to solve the equation $\operatorname{lcm}(60, n)=777+\operatorname{gcd}(60, n)$. The greatest common divisor must be a divisor of 60 , i.e. it must be one of the numbers $1,2,3,4,5,6,10,12,15,20,30$, or 60 . Of those divisors, only the number 3 can be added to 777 to obtain a multiple of 60 . Thus $\operatorname{gcd}(60, n)=3$ and $\operatorname{lcm}(60, n)=780$. Then $60 \cdot n=3 \cdot 780$, so $n=39$.
Problem 12. An ant sits in the centre of a face of a regular tetrahedron of edge length 1. By crawling on the surface of the tetrahedron it wants to get to the centre of an edge that does not lie on the same face as the ant sits in. What is the length of the shortest way that it needs to walk to get there?
Result. $\quad \sqrt{7 / 12} \doteq 0.76376$
Solution.
Let us "unwrap" the surface of the tetrahedron as shown by the figure. The ant sits at the point $A$ and wants to get to $B$. Since the net is planar, the shortest way has to be a line segment (dashed line). We get $|P D|$ from the Pythagorean theorem as $|P D|^{2}=|C D|^{2}-|C P|^{2}=1^{2}-(1 / 2)^{2}=3 / 4$, i.e., $|P D|=\sqrt{3 / 4}$. Thus
Since $|D B|=1 / 2$, we can apply the Pythagorean theorem once again and compute
which gives the answer
Problem 13. Agnieszka, Brunhilda, Cecilia and Doina drew numbers 3, 6, 9 and 12 without repetitions in some order. (No number was shared by two or more women.) We know that two of them always lie and two say the truth. They said the following:
- Agnieszka: I got twice as much as Doina.
- Brunhilda: I got three times as much as Doina.
- Cecilia: I got four times as much as Doina.
- Doina: I did not get the least.
What is the product of the numbers that the two liars got?
Result. 27
Solution. If Doina got 3, she would lie. Therefore, exactly one of the others would have to lie, which is not possible, since two ladies would have to have drawn the same number. If Doina got 9 or 12 , all others would lie, since it is not possible to draw any multiple thereof, thus Doina got 6 . The only one of the others who could tell the truth is Agnieszka. Thus she got 12. Therefore, the two liars are Brunhilda and Cecilia, who got 3 and 9 in some order. The product of their numbers is 27 .
Problem 14. Find the smallest positive integer that has exactly 24 positive divisors and exactly 8 of them are odd. Result. 420
Solution. Recall that for any positive integer $n$ with factorization $n=p_{1}{ }^{a_{1}} \cdots p_{k}{ }^{a_{k}}$ such that the $p_{i}$ are distinct primes, the number of all positive divisors of $n$ is equal to $\left(a_{1}+1\right) \cdots\left(a_{k}+1\right)$.
Obviously, the number of odd divisors can be found by just omitting all factors 2 in the prime decomposition of $n$. Because $24=8 \cdot 3$ and with the fact that the number of odd divisors has to be 8 , we get that the power of 2 must be 2 . Since $2 \cdot 2 \cdot 2=4 \cdot 2=8$, we have to consider either first powers of the three smallest prime numbers or the third power of the smallest one and the first power of the second smallest one or the 7 -th power of the smallest one. But $3 \cdot 5 \cdot 7<3^{3} \cdot 5<3^{7}$, so the smallest number $n$ is equal to $2^{2} \cdot 3 \cdot 5 \cdot 7=420$.
Problem 15. A circle and a square have the same centre. If the grey regions have the same area, what is the ratio of the side of the square to the radius of the circle?
Result. $\quad \sqrt{\pi} \doteq 1.77246$
Solution. Since the grey regions have the same area, the circle and the square have the same area, because this area equals the area of the overlap plus the quadruple of the area of a single grey region. If $a$ denotes the side length of the square and $r$ the radius of the circle, we get $a^{2}=r^{2} \pi$ and therefore $a: r=\sqrt{\pi}$.
Problem 16. Lenka wrote the sequence $1,2,3, \ldots, 20$ and a plus or minus sign between each pair of consecutive numbers in such a way that the resulting sum equalled 192. In how many ways could she have done that?
Result. 5
Solution. Note that one will be positive, since minuses were put only in between the numbers.
If all the signs are plus, the result is 210 . She got 18 less, so she had to place a minus sign in front of numbers with combined sum 9. These are one triplet (the smallest one) $(2,3,4)$, three pairs $(2,7),(3,6),(4,5)$ and the single number 9 . Thus we are left with five possibilities.
Problem 17. Three squares have been put into an isosceles right triangle as in the picture:
What fraction of the area of the triangle is taken by the cyan square?
Result. $1 / 81$
Solution. The key observation is that the length of the side of the yellow square is one third of the base of the triangle; this can be easily seen by extending the "outer" triangles to squares.
From this we conclude that the area ratio of the yellow square to the triangle is
Using the observation again, the side length of the cyan square is one sixth of that of the yellow square, hence their area ratio is $1 / 36$. We get the desired ratio by multiplying these two, obtaining $1 / 81$.
Problem 18. Find the sum of all positive integers which cannot be written as $2 a+3 b$ for some coprime positive integers $a$ and $b$.
Recall that positive integers $m$ and $n$ are coprime if $\operatorname{gcd}(m, n)=1$.
Result. 26
Solution. We can easily see that we cannot get any of $1,2,3,4,6,10$, since we have $a, b \geq 1$ and $\operatorname{gcd}(a, b)=1$. On the other hand take the coprime couples $(a, b)$ of the form $(a, 1)$ to write all odd numbers $n \geq 5$, take $(2 k-3,2)$ to express all $n=4 k \geq 8$, and $(2 k-5,4)$ for numbers $n=4 k+2 \geq 14$. Therefore the desired sum is $1+2+3+4+6+10=26$.
Problem 19. A polynomial is called heavy if it has two integer roots differing by one, all of its coefficients are integers and their sum equals 2020. How many heavy quadratic polynomials, i.e. expressions of the form $a x^{2}+b x+c$, are there?
Result. 4
Solution. Since the polynomial has two roots, it can be represented as $c(x-a)(x-b)$, where $a, b$ are the integer roots and $c$ is the leading coefficient, thus being integer as well. The sum of the coefficients is easily computed as $c(a-1)(b-1)$. Since this equals $2020=2 \cdot 2 \cdot 5 \cdot 101$, and since $(a-1)$ and $(b-1)$ differ by one, we are left with four possibilities, namely $2020=1010 \cdot 1 \cdot 2,2020=1010 \cdot(-1) \cdot(-2), 2020=101 \cdot 4 \cdot 5$, and $2020=101 \cdot(-4) \cdot(-5)$.
Problem 20. A train consisted of 40 carriages numbered from 1 to 40 , each having the capacity of 40 passengers. At the beginning, there was one passenger sitting in carriage 1 , two passengers in carriage 2 etc., up to forty passengers in carriage 40. However, for technical reasons, the last carriage had to be removed from the train and all its passengers moved to the carriages with smaller number in such a way that they took the first available seat and if the carriage was already full, they proceeded to check the next one with a smaller number. During the journey, the same thing happened subsequently to carriages $39,38, \ldots, 23$. How many passengers were in carriage 2 after this had happened?
Result. 19
Solution. Note that there are altogether $40 \cdot 41 / 2=820$ passengers on the train. When the train consists of 22 carriages, its last 20 carriages have to be full, for otherwise there would have been only at most $1+2+39+19 \cdot 40=802$ passengers. This leaves 20 passengers to sit in the first two carriages and since the carriage 2 cannot be full, carriage 1 holds still only 1 passenger. It follows that there are 19 passengers in carriage 2 .
Problem 21. Jacek cannot buy envelopes, so he is planning to make them by himself. To make a rectangular envelope Jacek is taking a square sheet of paper with diagonal $30 \mathrm{cm}$, folds the left and the right corner, then folds the bottom corner and closes the envelope by folding the top corner. In order to glue the envelope correctly, there needs to be precisely $1 \mathrm{cm}$ overlap, as in the picture, and after closing the envelope the top corner cannot be below the bottom
edge of the envelope. What is the maximal possible width of the envelope?
Result. 18
Solution. Let the side lengths of the envelope be $a$ (the width) and $b$ (the height), and the diagonal of the square be equal to $d$. Looking at the triangles formed by the vertical folding lines (they are right angled and isosceles, so the length of the horizontal altitude equals half of the vertical hypotenuse), we observe that $d=b+a+2$. In order to fold properly, the inequality $\frac{d-b}{2} \leq b$, i.e. $b \geq \frac{d}{3}$ must hold. Together it gives $a \leq d-\frac{d}{3}-2=\frac{2}{3} d-2=18$.
Problem 22. Martha picked three positive integers $a, b, c$ and computed the three sums of pairs $a+b, b+c, c+a$, obtaining three distinct squares of integers. What was the smallest possible value of $a+b+c$ ?
Result. 55
Solution. Let $a+b=d^{2}, b+c=e^{2}, c+a=f^{2}$ for (necessarily distinct) positive integers $d, e, f$. WLOG $d<e<f$ and since Martha's numbers are positive,
Moreover, the sought value equals $\left(d^{2}+e^{2}+f^{2}\right) / 2$. Hence we are looking for a triple of squares satisfying $(\Omega)$ and having its sum even and minimal at the same time. Such a triple is $\left(d^{2}, e^{2}, f^{2}\right)=(25,36,49)$ and the answer is 55 .
Problem 23. In the following diagram, how many paths are there from point $A$ to point $B$ that use each arrow at most once? (One such path is drawn in violet.)
Result. $\quad 162=2 \cdot 3^{4}$
Solution. The path is completely determined by the following choices: First go either up or down (2 options) and then for each of the 4 vertical pairs of nodes: either do not use any vertical arrow, or use one of them, or use both (3 options each). Hence the answer is $2 \cdot 3^{4}=2 \cdot 81=162$.
Problem 24. How many four-digit numbers are there with the property that any two neighbouring digits differ exactly by 3? A number may not start with zero.
Result. 29
Solution. We code the numbers in the following way: we write U if the right digit is bigger than the left one and D if the right digit is smaller than the left one, e.g. 1474 is encoded as UUD and 1414 UDU. There are eight possible codes in total and for each of them the corresponding number is determined by the first digit:
| code | UUU | UUD | UDU | UDD | DUU | DUD | DDU | DDD |
|---|---|---|---|---|---|---|---|---|
| possible first digits | none | $1-3$ | $1-6$ | $3-6$ | $3-6$ | $3-9$ | $6-9$ | 9 |
In total, there are $3+6+4+4+7+4+1=29$ sought numbers.
Problem 25. Each of two circles of equal size touches the other circle and also two sides of a unit square as in the picture. Compute the side length of the dashed square, which shares one corner with the unit square and touches the circles.
Result. $\frac{1}{1+\sqrt{2}}=\sqrt{2}-1 \doteq 0.41421$
Solution. Let $x$ be the side length of the small square. The radii $r$ of the circles are $\frac{1-x}{2}$. The diagonal of the unit square is divided by the centres of the circles and their point of tangency into four segments. Two of them are the radii and two of them are diagonals in squares of sides $r$. Altogether, we have
and solving this equation gives $x=1-\frac{\sqrt{2}}{1+\sqrt{2}}=\frac{1}{1+\sqrt{2}}=\sqrt{2}-1$.
Problem 26. Real numbers $x_{1}, x_{2}, \ldots, x_{2020}$ have these properties:
- Whenever we sum all of the numbers except a single $x_{i}$ with $i$ odd, the result is 2 .
- Whenever we sum all of the numbers except a single $x_{i}$ with $i$ even, the result is 0 .
What is the value of the sum $x_{1}+x_{2}+\cdots+x_{2020}$ ?
Result. $2020 / 2019$
Solution. If we sum all the given equations, we obtain
so the sought result is $2020 / 2019$.
Problem 27. Two players are playing a game, alternating moves. Each move consists of changing a positive integer $n$ into another positive integer in the range $\left[\frac{n}{3}, \frac{n}{2}\right]$. A player who cannot move loses. For how many starting numbers in the range $[1,1000]$ is the first player able to win with optimal strategy?
Result. 620
Solution. Let us call winning the numbers for which there exists a strategy guaranteeing victory, and the rest of the numbers losing. Observe that a number $n$ is winning if and only if there is a losing number in the interval $\left[\frac{n}{3}, \frac{n}{2}\right]$; on the other hand, a number $n$ is losing if and only if every number from the interval $\left[\frac{n}{3}, \frac{n}{2}\right]$ is winning (which includes the option that there is actually no integer in that interval).
Clearly, 1 is a losing number, so according to the rules above, 2 and 3 are winning. This in turn implies that the numbers $4, \ldots, 7$ are losing, since for each of these numbers we have $\left[\frac{n}{3}, \frac{n}{2}\right] \cap \mathbb{N} \subseteq{2,3}$. Next we get that $8, \ldots, 21$ are winning etc. Continuing in the fashion, we obtain additional winning numbers $44, \ldots, 129,260, \ldots, 777$. Altogether there are 620 winning numbers.
Problem 28. Two circles with diameters $A B=17$ and $A C=7$ meet in points $A$ and $D$. We further know that $C D=4$. Consider all possible distances of the centres of the circles and compute their product.
Result. 60
Solution. Thales theorem yields two right angles at the point $D$ so the points $B, C$ and $D$ lie on one line. From the Pythagorean theorem we compute $B D^{2}=17^{2}-\left(7^{2}-4^{2}\right)=16^{2}$ and thus $B C=16 \pm 4$ (indeed, the right angles can be either identical or form a straight line). Connecting the centres of the circles we obtain a similar (with ratio $\frac{1}{2}$ ) triangle with $A B C$ and thus the desired distance equals either $20 / 2=10$ or $12 / 2=6$ and the desired product is 60 .
Problem 29. Seven trolleybuses run between fourteen stations on one line. Each trolleybus starts in one of the stations and moves in one direction until it reaches the end of the line, which is either the first or the last station on the line, where it turns around and continues in the other direction. All trolleybuses maintain constant speed and they pass exactly one station in a minute. MSc Birne has placed them in such a way, that
- there is at most one trolleybus at each station, and
- there will be at most one trolleybus at each station in one minute, no matter in what directions the trolleybuses go.
In how many ways could that have been done? The trolleybuses are considered identical.
Result. 20
Solution. The trolleybuses must not be in a distance of two stations. Obviously odd and even stations are independent and also obviously, both can accommodate at most 4 trolleybuses. Thus one has to accommodate 3 and the other 4 , so the solution is $2 \cdot N$, where $N$ is the number of ways in which 3 stones could be placed at seven places in a row such that they are separated by a free spaces. We first place the four free spaces in a line and then we place the three stones in between the free spaces. The first stone has 5 possibilities, the second 4 and the third 3 , since the stones are indistinguishable the result reads $N=(5 \cdot 4 \cdot 3) /(3 \cdot 2 \cdot 1)=10$. The final answer is therefore $2 \cdot 10=20$
Problem 30. Marian has written a book with 2020 pages labelled $1,2,3, \ldots 2020$. After revision, he added an abstract consisting of 11 pages in front of the book. How many digits does he have to rewrite so that every page gets its proper label? A digit from an old page number can only be used in the new one on the same position (ones, tens, hundreds, etc.) and newly written digits, such as the leading 1 appearing in the change $95 \rightarrow 106$, are not counted.
Result. 4251
Solution. First, let us calculate how many digits will remain the same. It is easy to see that for every one or two digit number the operation +11 will not leave any digit intact. So every digit that will be intact has to be on position of hundreds or thousands. If the last two digits of a page are labelled from 00 to 88 , the first two digits will be intact. This is the case for the hundreds digit for 89 numbers in each range of hundred. In addition, for every number from 1000 to 1988 we have one more stable digit - the thousand digit. So, considering all numbers up to 1999, we have $19 \cdot 89+989=2680$ digits that remain the same. From 2000 to 2020 , there are 21 numbers that will not change their hundred or thousand digit which gives $2 \cdot 21=42$ stable digits. Hence $2680+42=2722$ digits remain the same.
Now, how many digits are there in total? From 1 to 9 there are 9 digits. From 10 to 99 there are $90 \cdot 2$ digits. From 100 to 999 there are $900 \cdot 3$ digits and from 1000 to 2020 there are $1021 \cdot 4$ digits. So there are 6973 digits overall. Therefore, $6973-2722=4251$ digits have to be changed.
Problem 31. A puck is dropped into the top of the plinko box and slides downward until it falls out the bottom. How many different paths through the box are possible? One example path is shown.
Result. 65
Solution. We label each intersection point with the number of paths the puck can take from that point on. We start from the bottom of the box where there is only 1 path, and work our way up. Each number is the sum of the number or numbers immediately below it.
Problem 32. The king and his 100 knights sit down at the round table. The vegetarians are served cheese and everyone else is served chicken. But the king has a smaller portion of chicken than the knight to his left, so he orders everyone to pass their plate to the right. Now the king has a reasonable portion of chicken, but 64 knights have the wrong meal, so everyone passes their plate to the right again. Once more the king has a smaller portion of chicken than the knight to his left, so everyone passes their plate to the right a third time. Now only 2 knights (and not the king) have the wrong meal, so they trade places and the feast begins. How many of the king's knights ate chicken?
Result. 68
Solution. Notice that the king and the three knights to his left were all served chicken. So after the third pass, the first vegetarian meal to the king's left was passed to a meat-eater, and the first vegetarian to the king's right received meat. These are the two knights who had to trade places.
Everyone else was served the same dish as the person 3 places to their left, so the seating arrangement was
Then every vegetarian and every meat-eater to the right of a vegetarian had the wrong meal after the first pass. So there are $64 / 2=32$ vegetarians. The remaining $100-32=68$ knights (as well as the king) ate chicken.
Problem 33. David would love to draw a triangle $A B C$ and points $D, E$ in the interiors of sides $A B$ and $B C$ respectively in such a way, that triangles $A B C, A E C, A D E, B D E$ were similar. What is the sum of all possible values of the size of angle $B A C$ in degrees?
Result. 150
Solution. Let us denote the inner angles of triangle $A B C$ by $\alpha, \beta$ and $\gamma$, respectively, and note that the other three triangles have to have the same inner angles. Obviously $|\varangle E A C|=\beta$ and $|\varangle A E C|=\alpha$.
Since the sizes of angles $E D A$ and $E D B$ add up to $180^{\circ}$, which is also the sum of $\alpha, \beta$ and $\gamma$, they have to be the same, that is, they are both right. Moreover, they cannot equal $\beta$ as that would mean that triangle $B D E$ would have two right inner angles, so they are equal either to $\alpha$ or to $\gamma$. Straightforward angle chasing gives a unique solution to both possibilities, see figure below. The first one trivially means $\alpha=90^{\circ}$, while the other implies $3 \alpha=180^{\circ}$, i.e. $\alpha=60^{\circ}$. The sum of all possibilities thus equals $90^{\circ}+60^{\circ}=150^{\circ}$.

Problem 34. Five night workers have to schedule their shifts for the following 10 nights so that every night exactly two workers have a shift and those two workers cannot have the shift night after. How many time schedules containing each possible pair of the workers exist?
Result. 240
Solution. Let us draw the workers as nodes in a diagram, where a segment between two nodes represent the shift of the two workers. We are looking for the number of ways to draw all the $5 \cdot 4 / 2=10$ segments so that no two subsequent segments have a common node. The first segment can be chosen in 10 ways, the second in 3 ways and in the next two steps we always have two choices. However, no matter what choices we do, we get essentially the same situation, i.e. we can get any sequence of choices from any other by renumbering the nodes. The fifth choice may lead to two different outcomes: Either we obtain a cycle of five segments, or a cycle of four segments with a "tail". The former option leads to $1,2,1,1$, and 1 choices in the following steps, whereas the latter option cannot be completed in a valid way, since the final two segments would have to contain the "end of the tail". We conclude that there are
possible time schedules.
Problem 35. Lucy has got a triangle with side lengths 32,50 , and $x$. Furthermore, there is a triangle similar to and having two sides of the same length as Lucy's, but it is not congruent to it. Find the sum of all possible values of $x$. Result. $27721 / 200$
Solution. Let $a<b<c$ be the side lengths of Lucy's triangle. The situation described in the statement can happen only when lengths satisfy $a: b=b: c$. Now there are three options: (1) $a=32, b=50$, which leads to $x=c=50 \cdot \frac{50}{32}$; (2) $a=32, c=50$, which leads to $x=b=\sqrt{32 \cdot 50}=40$; (3) $b=32, c=50$, leading to $x=a=32 \cdot \frac{32}{50}$. It is easy to check that none of these situations violate the triangle inequality. The result is the sum of the three values.
Problem 36. A runner is training on a track shaped as the perimeter of a regular 40-gon. His training plan is as follows: first, he runs from the initial vertex to the clockwise-adjacent one and has a short break there. He continues in this manner until he has a break at the initial vertex. Then he starts again, this time having a break after passing every other edge and again continues until a break at the initial vertex where he further increases the length of one sprint by one, etc. How many times will the runner rest before completing a whole loop without a break around the 40-gon? There is no break at the beginning nor after this last run.
Result. 902
Solution. Let us observe that the runner does exactly $\frac{40}{\operatorname{GCD}(40, a)}$ steps (runs) of size $a$ edges where $\operatorname{GCD}(x, y)$ stands for the greatest common divisor of positive integers $x, y$. For all possible numbers $d=\operatorname{GCD}(40, a)$ (divisors of 40) we list the possible values of $a$ :
- $d=1$ for $a \in{1,3,7,9,11,13,17,19,21,23,27,29,31,33,37,39}$,
- $d=2$ for $a \in{2,6,14,18,26,34,38}$,
- $d=4$ for $a \in{4,12,28,36}$,
- $d=5$ for $a \in{5,15,25,35}$,
- $d=8$ for $a \in{8,16,24,32}$,
- $d=10$ for $a \in{10,30}$,
- $d=20$ for $a \in{20}$,
- $d=40$ for $a \in{40}$.
The total number of steps can now be obtained by summing the products of $\frac{40}{d}$ and the size of the set on the respective row ${ }^{1}$ above. We obtain $40 \cdot 16+20 \cdot 8+10 \cdot 4+8 \cdot 4+5 \cdot 4+4 \cdot 2+2 \cdot 1+1 \cdot 1=903$. It means that the runner rested 902 times.
Problem 37. A doctoral student living on a cubic planet needs to spend a travelling budget by visiting universities which are located at the vertices of the cube. The budget covers 2020 trips and must be used completely. The student starts at his home university and realises the first trip by moving to one of the neighbouring (by an edge of the cube) universities. He always chooses the next university to visit randomly with the only condition that he cannot return home sooner than by the 2020-th trip. What is the probability that he comes back home by the 2020-th trip?
Result. $\quad 2 / 9$
Solution. Let us denote the initial vertex (i.e. the home university) by $A$, its neighbours by $B_{1}, B_{2}$ and $B_{3}$, their neighbours (different from $A$ ) by $C_{1}, C_{2}$ and $C_{3}$ and finally the last vertex by $D$. It is easy to see that after an odd number of steps (i.e. trips) the only possible positions are $B_{i}$ or $D$ and after an even number only $C_{i}$ or $A$ (which is not allowed before the 2020-th step) are possible. Let us denote $P_{n}(V)$ the probability of reaching vertex $V$ after the $n$-th step. Due to symmetry, we have $P_{n}\left(B_{1}\right)=P_{n}\left(B_{2}\right)=P_{n}\left(B_{3}\right)=: P_{n}(B)$ for every $n$ and analogously for vertices $C_{i}$. The only non-zero probabilities in the first steps are easy to compute by the given rules:
- $P_{0}(A)=1$
- $P_{1}(B)=\frac{1}{3}$
- $P_{2}(C)=\frac{1}{3}$
- $P_{3}(D)=\frac{1}{3}, P_{3}(B)=\frac{2}{9}$
- $P_{4}(C)=\frac{1}{3}$.
Observing that after 4 steps the situation is identical to the one after 2 steps, we infer that the process is periodic and $P_{2019}(B)=\frac{2}{9}$, hence (now returning to $A$ is again possible)
Problem 38. Let us define $x \star n=(2-x)^{n}+x^{3}-6 x^{2}+12 x-5$ for any real number $x$ and a positive integer $n$. Determine the sum of all real numbers $a$ solving equation
Result. 27
Solution. Noticing that $x \star 3=3$ for any real $x$ we easily compute that $a=(3 \star 2) \star 1=5 \star 1=27$ is the only solution.[^0]
Problem 39. Four friends decided to enrol in some of the four different available courses. They decided that each of them enrols in at least one course and that there will be exactly one course in which more than one of them enrol. In how many ways can they do that?
Result. 2052
Solution. Let us label the courses $1,2,3$ and 4 while the friends $A, B, C$ and $D$. Let us assume that course 1 is the one which is selected by more than one of them (after calculating the result with this assumption, it will only need to be multiplied by 4). Therefore we have only five ways of assigning course 2 (now it can be chosen by $A, B, C$ and $D$ or nobody). Similarly, we have five ways of assigning courses 3 and 4 . On summary, there are $5^{3}=125$ ways of assigning these three courses. In one of these possibilities, no friends got no courses; in $4 \cdot 3 \cdot 2=24$ possibilities, three of the friends got one course each.
Now, we have to calculate how many possibilities are there for exactly one student to get some courses. There are $4 \times 3$ possibilities where one of them got exactly one course and the remaining two courses were null (chosen by nobody); $4 \times 3$ possibilities where one of them chose exactly two courses and one course was null; and 4 possibilities where one of them got all three considered courses. In total, this gives $4 \cdot 3+4 \cdot 3+4=28$ possibilities. It also means that there are $125-1-24-28=72$ possibilities for exactly two students to get some courses.
Having discovered that, we can get back to assigning course 1, the last of them, which is also the only multiple one. We know that every student without previous choices has to get this one, while every student with previous choices can get it or not, provided that there are at least two students with this course. It means that there is exactly 1 way of assigning course 1 if no students have previous courses; exactly 2 ways if one student has previous courses; exactly 4 ways if two students have previous courses; exactly 7 ways if three students have previous courses (seven because at least one of these three students has to choose course 1 nevertheless). This renders the final calculation: $4(1 \cdot 1+28 \cdot 2+72 \cdot 4+24 \cdot 7)=2052$.
Problem 40. Consider the sum of all numbers having exactly $1000^{1000}$ digits, all of them being only 1,2 , or 4 . What are the last three digits of this sum?
Result. 259
Solution. Let $n$ be a number consisting only of digits 1,2 , and 4 . If we replace all its digits 1 by 2 , all 2 by 4 , and all 4 by 1 , we obtain another number having only these digits, and applying this operation two more times produces the original number $n$. Let us group all the summed numbers into triples, in which the numbers can be obtained from each other using this cyclic substitution. The sum of every such triplet is equal to the number $B$ consisting of $1000^{1000}$ digits 7 , because each digit is the sum of 1,2 , and 4 in some order. The total number of summed numbers is $3^{1000^{1000}}$, hence the number of triplets is $3^{1000^{1000}}-1$ and the sum in question is thus equal to
Since we are interested only in last three digits, let us compute remainders modulo 1000. Clearly, $B \equiv 777$ (mod 1000). Furthermore, as 3 and 1000 are coprime we may use Euler's Theorem to handle the large power of 3: We have $\varphi(1000)=400$, which is clearly a divisor of $1000^{1000}$, hence
where the negative exponent stands for modular inverse. Since
we conclude that the modular inverse of 3 is $-333 \equiv 667(\bmod 1000)$. Therefore, our sought number is
Problem 41. In the triangle $A B C$, the angle at vertex $A$ is twice as big as the angle at vertex $B$. All sides are integer valued and the length of the side $B C$ is as small as possible. What is the product of the side lengths of the triangle?
Result. 120
Solution. Denoting the lengths of sides $a, b$ and $c$ in a usual way and $\beta$ the angle by $B$. Form the sine law we get
which gives the value of $\cos \beta=\frac{a}{2 b}$. Again from the sine law, trigonometric equalities and calculated value of $\cos \beta$ we get now
The smallest $a$ for which there exist $b$ and $c$ satisfying this equation and being the side lengths of a triangle is $a=6$, with $b=4$ and $c=5$. Thus, the product of the side lengths is 120 .
Problem 42. There is a round table with 30 seats. In how many ways can we choose some (at least one) of the seats in such a way that no two neighbouring seats are chosen? Choices which differ by rotation are considered distinct.
Result. 1860497
Solution. Let $A(n)$ be the number of such choices for a table with $n$ seats; for convenience, we will also include the choice of zero seats in this number. We will prove the recurrence relation
for $n \geq 5$. Let us call a subset $M$ of ${1, \ldots, n}$ cyclically sparse if it contains no consecutive numbers and does not contain 1 and $n$ at the same time. Clearly, $A(n)$ is equal to the number of cyclically sparse subsets of ${1, \ldots, n}$.
Let $B(n)$ be the number of sparse subsets of ${1, \ldots, n}$, i.e. those not containing consecutive numbers (there is no condition on 1 and $n$ ). Then $B(n)$ satisfies the relation $B(n)=B(n-1)+B(n-2)$ - indeed there are $B(n-1)$ such subsets not containing $n$ and $B(n-2)$ such subsets containing $n$.
Let us perform a similar analysis on $A(n)$ : The number of cyclically sparse subsets containing $n$ is equal to $B(n-3)$, because such a subset does not contain 1 and $n-1$, while the rest of the elements form any sparse subset of ${2, \ldots, n-2}$. Further, if a cyclically sparse subset does not contain $n$, then the remaining elements may form any sparse subset of ${1, \ldots, n-1}$. Therefore
a relation which holds for any integer $n \geq 3$. Since the (shifted) sequences $B(n-1)$ and $B(n-3)$ satisfy the desired relation, so does their sum $A(n)$, hence we have proved (R) for $n \geq 5$.
It is easy to see that $A(3)=4$ and $A(4)=7$. Using $(\mathrm{R})$, we can now compute all further values, in particular $A(30)=1860498$. Since the statement excludes the possibility of no seat chosen, the result is one less.
Problem 43. Martin attended an online workshop on wire bending and got a homework to manufacture the construction from the picture. He remembered the two marked pairs of equally large angles and lengths of three line segments. Unfortunately, he forgot the fourth one (marked by "?") and thus is now struggling with the homework. Help him and determine the missing length.
Result. $\quad 5 \sqrt{\frac{7}{2}} \doteq 9.354134$
Solution.
Let us draw a line parallel to $D F$ through point $A$ as in the figure and denote its intersection with the line $C D$ by $E$. Denoting $x$ the desired length $C D$, we conclude from similar triangles $C D F \sim C E A$ that $E D=\frac{4}{10} x=\frac{2 x}{5}$ and $E A=\frac{10+4}{10} \cdot 5=7$. Since $\angle A E C=\angle F D C=\angle D B C$, the quadrilateral $A E B C$ is cyclic. It follows in turn that $\angle E A B=\angle E C B=\angle A C D$. Hence $E D A \sim E A C$ and thus
Problem 44. Consider functions $f: \mathbb{N} \rightarrow \mathbb{N}$ satisfying the condition
for all $m, n \in \mathbb{N}$. Find the arithmetic mean of all possible values of $f(2020)$.
Result. 1011
Solution. We claim that $f(n) \leq n+1$ for all $n \in \mathbb{N}$. Since $f(n+1) \geq f(n)+f(f(1))-1 \geq f(n)$ for any $n \in \mathbb{N}, f$ is non-decreasing. Assume that
in other words $f(m)=m+c$ for some $c \in \mathbb{N}, c \geq 2$. Then
and by applying this argument inductively we get $f\left(2^{r} m\right) \geq 2^{r} m+2^{r}(c-1)+1$. Combining this inequality, the one from statement and the fact that $f$ is non-decreasing, we obtain
so again by the monotonicity $f\left(2^{r} m+1\right)=f\left(2^{r} m+2\right)=\cdots=f\left(2^{r} m+2^{r}(c-1)+1\right)$. For all $k \in \mathbb{N}$ choose $r_{k} \in \mathbb{N}$ such that $2^{r_{k}}(c-1)>k$. Then
and hence $f(f(k)) \leq 1$ meaning $f(f(k))=1$ for all $k \in \mathbb{N}$. Hence also $1=f(f(m))=f(m+c) \geq f(m)$ and hence $f(m)=1$ contradicting the assumption (1). Hence indeed $f(n) \leq n+1$ for all $n \in \mathbb{N}$.
In fact, for a given positive integer $N>1$, the value $f(N)$ can be any element of the set ${1,2, \ldots, N+1}$. To see this, let first $A<N$. Define $f_{1}(n)=1$ if $n \leq A$ and $f_{1}(n)=A$ if $n>A$. The function $f_{1}$ satisfies the condition and $f_{1}(N)=A$. Secondly, the function $f_{2}(n)=n$ also satisfies the condition and $f_{2}(N)=N$. Lastly, the function $f_{3}(n)=N\left\lfloor\frac{n}{N}\right\rfloor+1$ gives $f_{3}(N)=N+1$ and it also satisfies the condition. Indeed, we have
where we used that $\left\lfloor\frac{n}{N}\right\rfloor+\frac{1}{N}<\left\lfloor\frac{n}{N}\right\rfloor+1$ for $N>1$ and that $\lfloor x\rfloor+\lfloor y\rfloor \leq\lfloor x+y\rfloor$ for any real numbers $x, y \in(0, \infty)$.
Since $2020>1$, the result is simply the average of all the positive integers from 1 to 2021, i.e. $\frac{2022}{2}=1011$.
Problem 45. Farmer Karl possesses a quadrangular piece of land with the side lengths $a=40, b=20, c=28, d=32$ as in the picture. By heritage he receives the two triangular pieces of land $B E C$ and $D C F$, which are delimited by the original sides of his land and their extensions, respectively. If he needs a fence of length 80 for the section $B E+E C$, how long is the fence for the section $C F+F D$ ?
Result. 88
Solution. First of all, we show that the triangles $\triangle B E C, \triangle A E D, \triangle D C F$ and $\triangle A B F$ have an identical excircle lying in the angle $E A F$.
Let $G$ denote the tangent point of the $B$-excircle of triangle $\triangle B E C$ lying on $A B$. The distance between $B$ and $G$ is half the perimeter of the triangle, i.e. $B G=\frac{1}{2}(C B+B E+E C)$. Now let $G^{\prime}$ be the tangent point of the $A$-excircle of triangle $\triangle A E D$ lying on $A B$. Using $a+b=60=c+d$ we get
and hence $G=G^{\prime}$. Therefore, the tangent point $O$ on side $C E$ is uniquely determined for both triangles and it follows that the triangles $\triangle B E C$ and $\triangle A E D$ have an identical excircle. By analogy, we can show that the triangles $\triangle D C F$ and $\triangle A B F$ have also the same excircle. It is even identical for all four triangles under consideration since the center point of the excircle has to lie on the angular bisector of $\angle E A F$ and on the angular bisector of $\angle E C F$. Since the tangents to a circle have equal lengths, from $A G=A H$ we get that the triangles $\triangle A E D$ and $\triangle A B F$ have perimeters of equal lengths. Hence we obtain
as the length of $C F+F D$.
Problem 46. Determine for how many $k \in{1, \ldots, 2020}$ the equation $p^{3}+q^{3}+r^{3}=3 p q r+k$ has a solution $(p, q, r)$ for some positive integers $p, q, r$.
Result. 1568
Solution. Let us write the equation in the form
Note that if the last bracket is nonzero, then it equals at least two and the numbers $p, q, r$ cannot be all equal. Hence $k \geq(1+1+2) \cdot \frac{1}{2} \cdot 2 \geq 4$. The triple $(p, q, r)=(n, n, n+1)$ is a solution for $k=3 n+1$ for any $n \geq 1$. Similarly, the triple $(p, q, r)=(n, n+1, n+1)$ is a solution for $k=3 n+2$ for any $n \geq 1$. If $3 \mid k$ then by rewriting the equation as
we see that also $3 \mid p+q+r$ and thus necessarily $9 \mid k$. On the other hand, the triple $(p, q, r)=(n-1, n, n+1)$ solves the equation with $k=9 n$ for any $n \geq 2$. It only remains to investigate the case $k=9$ If the positive integers $p, q, r$ are pairwise different, we have $k=\frac{1}{2}(p+q+r)\left((p-q)^{2}+(q-r)^{2}+(r-p)^{2}\right) \geq(1+2+3) \frac{1}{2}(1+1+4)=18$ and if $p=q \neq r$ we have $9=(2 p+r)(p-r)^{2}$ and since $2 p+r>1$ we must have $2 p+r=9$ and $|p-r|=1$ which is impossible as then $r=p \pm 1$ and $9 \neq 3 p \pm 1$. In conclusion, all the admissible $k \in{1, \ldots, 2020}$ can be obtained by removing from the set the numbers smaller than 4 and multiples of 3 and then adding the multiples of 9 larger than 9 . Hence the result is $2020-3-672+223=1568$.
[^0]: ${ }^{1}$ these sizes can be expressed using Euler's totient function as $\varphi(40 / d)$.






















