# APMO 2022 Solution Problem 1. Find all pairs $(a, b)$ of positive integers such that $a^{3}$ is a multiple of $b^{2}$ and $b-1$ is a multiple of $a-1$. Note: An integer $n$ is said to be a multiple of an integer $m$ if there is an integer $k$ such that $n=k m$. ## Solution 1.1 By inspection, we see that the pairs $(a, b)$ with $a=b$ are solutions, and so too are the pairs $(a, 1)$. We will see that these are the only solutions. - Case 1. Consider the case $b0$. Then $E=\left(-\frac{d}{2}, \frac{a}{2}\right)$. The general equation of a circle is $$ x^{2}+y^{2}+2 f x+2 g y+h=0 $$ Substituting the coordinates of $A, D, C$ into (1) and solving for $f, g, h$, we find that the equation of the circumcircle of $\triangle A D C$ is $$ x^{2}+y^{2}+(d-c) x+\left(\frac{c d}{a}-a\right) y-c d=0 $$ Similarly, the equation of the circumcircle of $\triangle B D E$ is $$ x^{2}+y^{2}+d x+\left(\frac{d^{2}}{2 a}-\frac{a}{2}\right) y=0 $$ Then (3)-(2) gives the equation of the line $D F$ which is $$ c x+\frac{a^{2}+d^{2}-2 c d}{2 a} y+c d=0 $$ Solving (3) and (4) simultaneously, we get $$ F=\left(\frac{c\left(d^{2}-a^{2}-2 c d\right)}{a^{2}+(d-2 c)^{2}}, \frac{2 a c(c-d)}{a^{2}+(d-2 c)^{2}}\right) $$ and the other solution $D=(-d, 0)$. From this we obtain the equation of the line $E F$ which is $a x+(d-2 c) y+a c=0$. It passes through $P(-c, 0)$ which is independent of $d$. Problem 3. Find all positive integers $k<202$ for which there exists a positive integer $n$ such that $$ \left\{\frac{n}{202}\right\}+\left\{\frac{2 n}{202}\right\}+\cdots+\left\{\frac{k n}{202}\right\}=\frac{k}{2} $$ where $\{x\}$ denote the fractional part of $x$. Note: $\{x\}$ denotes the real number $k$ with $0 \leq k<1$ such that $x-k$ is an integer. ## Solution Denote the equation in the problem statement as $\left(^{*}\right)$, and note that it is equivalent to the condition that the average of the remainders when dividing $n, 2 n, \ldots, k n$ by 202 is 101 . Since $\left\{\frac{i n}{202}\right\}$ is invariant in each residue class modulo 202 for each $1 \leq i \leq k$, it suffices to consider $0 \leq n<202$. If $n=0$, so is $\left\{\frac{i n}{202}\right\}$, meaning that $(*)$ does not hold for any $k$. If $n=101$, then it can be checked that $\left(^{*}\right)$ is satisfied if and only if $k=1$. From now on, we will assume that $101 \nmid n$. For each $1 \leq i \leq k$, let $a_{i}=\left\lfloor\frac{i n}{202}\right\rfloor=\frac{i n}{202}-\left\{\frac{i n}{202}\right\}$. Rewriting $\left(^{*}\right)$ and multiplying the equation by 202, we find that $$ n(1+2+\ldots+k)-202\left(a_{1}+a_{2}+\ldots+a_{k}\right)=101 k $$ Equivalently, letting $z=a_{1}+a_{2}+\ldots+a_{k}$, $$ n k(k+1)-404 z=202 k $$ Since $n$ is not divisible by 101 , which is prime, it follows that $101 \mid k(k+1)$. In particular, $101 \mid k$ or $101 \mid k+1$. This means that $k \in\{100,101,201\}$. We claim that all these values of $k$ work. - If $k=201$, we may choose $n=1$. The remainders when dividing $n, 2 n, \ldots, k n$ by 202 are 1,2 , ..., 201, which have an average of 101 . - If $k=100$, we may choose $n=2$. The remainders when dividing $n, 2 n, \ldots, k n$ by 202 are 2,4 , ..., 200, which have an average of 101. - If $k=101$, we may choose $n=51$. To see this, note that the first four remainders are $51,102,153$, 2 , which have an average of 77 . The next four remainders $(53,104,155,4)$ are shifted upwards from the first four remainders by 2 each, and so on, until the 25 th set of the remainders ( 99 , $150,201,50)$ which have an average of 125 . Hence, the first 100 remainders have an average of $\frac{77+125}{2}=101$. The 101th remainder is also 101 , meaning that the average of all 101 remainders is 101 . In conclusion, all values $k \in\{1,100,101,201\}$ satisfy the initial condition. Problem 4. Let $n$ and $k$ be positive integers. Cathy is playing the following game. There are $n$ marbles and $k$ boxes, with the marbles labelled 1 to $n$. Initially, all marbles are placed inside one box. Each turn, Cathy chooses a box and then moves the marbles with the smallest label, say $i$, to either any empty box or the box containing marble $i+1$. Cathy wins if at any point there is a box containing only marble $n$. Determine all pairs of integers $(n, k)$ such that Cathy can win this game. ## Solution We claim Cathy can win if and only if $n \leq 2^{k-1}$. First, note that each non-empty box always contains a consecutive sequence of labeled marbles. This is true since Cathy is always either removing from or placing in the lowest marble in a box. As a consequence, every move made is reversible. Next, we prove by induction that Cathy can win if $n=2^{k-1}$. The base case of $n=k=1$ is trivial. Assume a victory can be obtained for $m$ boxes and $2^{m-1}$ marbles. Consider the case of $m+1$ boxes and $2^{m}$ marbles. Cathy can first perform a sequence of moves so that only marbles $2^{m-1}, \ldots, 2^{m}$ are left in the starting box, while keeping one box, say $B$, empty. Now move the marble $2^{m-1}$ to box $B$, then reverse all of the initial moves while treating $B$ as the starting box. At the end of that, we will have marbles $2^{m-1}+1, \ldots, 2^{m}$ in the starting box, marbles $1,2, \ldots, 2^{m-1}$ in box $B$, and $m-1$ empty boxes. By repeating the original sequence of moves on marbles $2^{m-1}+1, \ldots, 2^{m}$, using the $m$ boxes that are not box $B$, we can reach a state where only marble $2^{m}$ remains in the starting box. Therefore a victory is possible if $n=2^{k-1}$ or smaller. We now prove by induction that Cathy loses if $n=2^{k-1}+1$. The base case of $n=2$ and $k=1$ is trivial. Assume a victory is impossible for $m$ boxes and $2^{m-1}+1$ marbles. For the sake of contradiction, suppose that victory is possible for $m+1$ boxes and $2^{m}+1$ marbles. In a winning sequence of moves, consider the last time a marble $2^{m-1}+1$ leaves the starting box, call this move $X$. After $X$, there cannot be a time when marbles $1, \ldots, 2^{m-1}+1$ are all in the same box. Otherwise, by reversing these moves after $X$ and deleting marbles greater than $2^{m-1}+1$, it gives us a winning sequence of moves for $2^{m-1}+1$ marbles and $m$ boxes (as the original starting box is not used here), contradicting the inductive hypothesis. Hence starting from $X$, marbles 1 will never be in the same box as any marbles greater than or equal to $2^{m-1}+1$. Now delete marbles $2, \ldots, 2^{m-1}$ and consider the winning moves starting from $X$. Marble 1 would only move from one empty box to another, while blocking other marbles from entering its box. Thus we effectively have a sequence of moves for $2^{m-1}+1$ marbles, while only able to use $m$ boxes. This again contradicts the inductive hypothesis. Therefore, a victory is not possible if $n=2^{k-1}+1$ or greater. Problem 5. Let $a, b, c, d$ be real numbers such that $a^{2}+b^{2}+c^{2}+d^{2}=1$. Determine the minimum value of $(a-b)(b-c)(c-d)(d-a)$ and determine all values of $(a, b, c, d)$ such that the minimum value is achieved. ## Solution The minimum value is $-\frac{1}{8}$. There are eight equality cases in total. The first one is $$ \left(\frac{1}{4}+\frac{\sqrt{3}}{4},-\frac{1}{4}-\frac{\sqrt{3}}{4}, \frac{1}{4}-\frac{\sqrt{3}}{4},-\frac{1}{4}+\frac{\sqrt{3}}{4}\right) . $$ Cyclic shifting all the entries give three more quadruples. Moreover, flipping the sign $((a, b, c, d) \rightarrow$ $(-a,-b,-c,-d))$ all four entries in each of the four quadruples give four more equality cases. ## Solution 5.1 Since the expression is cyclic, we could WLOG $a=\max \{a, b, c, d\}$. Let $$ S(a, b, c, d)=(a-b)(b-c)(c-d)(d-a) $$ Note that we have given $(a, b, c, d)$ such that $S(a, b, c, d)=-\frac{1}{8}$. Therefore, to prove that $S(a, b, c, d) \geq$ $-\frac{1}{8}$, we just need to consider the case where $S(a, b, c, d)<0$. - Exactly 1 of $a-b, b-c, c-d, d-a$ is negative. Since $a=\max \{a, b, c, d\}$, then we must have $d-a<0$. This forces $a>b>c>d$. Now, let us write $$ S(a, b, c, d)=-(a-b)(b-c)(c-d)(a-d) $$ Write $a-b=y, b-c=x, c-d=w$ for some positive reals $w, x, y>0$. Plugging to the original condition, we have $$ (d+w+x+y)^{2}+(d+w+x)^{2}+(d+w)^{2}+d^{2}-1=0(*) $$ and we want to prove that $w x y(w+x+y) \leq \frac{1}{8}$. Consider the expression $(*)$ as a quadratic in $d$ : $$ 4 d^{2}+d(6 w+4 x+2 y)+\left((w+x+y)^{2}+(w+x)^{2}+w^{2}-1\right)=0 $$ Since $d$ is a real number, then the discriminant of the given equation has to be non-negative, i.e. we must have $$ \begin{aligned} 4 & \geq 4\left((w+x+y)^{2}+(w+x)^{2}+w^{2}\right)-(3 w+2 x+y)^{2} \\ & =\left(3 w^{2}+2 w y+3 y^{2}\right)+4 x(w+x+y) \\ & \geq 8 w y+4 x(w+x+y) \\ & =4(x(w+x+y)+2 w y) \end{aligned} $$ However, AM-GM gives us $$ w x y(w+x+y) \leq \frac{1}{2}\left(\frac{x(w+x+y)+2 w y}{2}\right)^{2} \leq \frac{1}{8} $$ This proves $S(a, b, c, d) \geq-\frac{1}{8}$ for any $a, b, c, d \in \mathbb{R}$ such that $a>b>c>d$. Equality holds if and only if $w=y, x(w+x+y)=2 w y$ and $w x y(w+x+y)=\frac{1}{8}$. Solving these equations gives us $w^{4}=\frac{1}{16}$ which forces $w=\frac{1}{2}$ since $w>0$. Solving for $x$ gives us $x(x+1)=\frac{1}{2}$, and we will get $x=-\frac{1}{2}+\frac{\sqrt{3}}{2}$ as $x>0$. Plugging back gives us $d=-\frac{1}{4}-\frac{\sqrt{3}}{4}$, and this gives us $$ (a, b, c, d)=\left(\frac{1}{4}+\frac{\sqrt{3}}{4},-\frac{1}{4}+\frac{\sqrt{3}}{4}, \frac{1}{4}-\frac{\sqrt{3}}{4},-\frac{1}{4}-\frac{\sqrt{3}}{4}\right) $$ Thus, any cyclic permutation of the above solution will achieve the minimum equality. - Exactly 3 of $a-b, b-c, c-d, d-a$ are negative Since $a=\max \{a, b, c, d\}$, then $a-b$ has to be positive. So we must have $bd>c>b$. By the previous case, $S(a, d, c, b) \geq-\frac{1}{8}$, which implies that $$ S(a, b, c, d)=S(a, d, c, b) \geq-\frac{1}{8} $$ as well. Equality holds if and only if $$ (a, b, c, d)=\left(\frac{1}{4}+\frac{\sqrt{3}}{4},-\frac{1}{4}-\frac{\sqrt{3}}{4}, \frac{1}{4}-\frac{\sqrt{3}}{4},-\frac{1}{4}+\frac{\sqrt{3}}{4}\right) $$ and its cyclic permutation. ## Solution 5.2 The minimum value is $-\frac{1}{8}$. There are eight equality cases in total. The first one is $$ \left(\frac{1}{4}+\frac{\sqrt{3}}{4},-\frac{1}{4}-\frac{\sqrt{3}}{4}, \frac{1}{4}-\frac{\sqrt{3}}{4},-\frac{1}{4}+\frac{\sqrt{3}}{4}\right) . $$ Cyclic shifting all the entries give three more quadruples. Moreover, flipping the sign $((a, b, c, d) \rightarrow$ $(-a,-b,-c,-d)$ ) all four entries in each of the four quadruples give four more equality cases. We then begin the proof by the following optimization: Claim 1. In order to get the minimum value, we must have $a+b+c+d=0$. Proof. Assume not, let $\delta=\frac{a+b+c+d}{4}$ and note that $$ (a-\delta)^{2}+(b-\delta)^{2}+(c-\delta)^{2}+(d-\delta)^{2}