# SOLUTIONS FOR 2012 APMO PROBLEMS ## Problem 1. Solution: Let us denote by $\triangle X Y Z$ the area of the triangle $X Y Z$. Let $x=\triangle P A B, y=\triangle P B C$ and $z=\triangle P C A$. From $$ y: z=\triangle B C P: \triangle A C P=B F: A F=\triangle B P F: \triangle A P F=(x-1): 1 $$ follows that $z(x-1)=y$, which yields $(z+1) x=x+y+z$. Similarly, we get $(x+1) y=x+y+z$ and $(y+1) z=x+y+z$. Thus, we obtain $(x+1) y=(y+1) z=$ $(z+1) x$. We may assume without loss of generality that $x \leq y, z$. If we assume that $y>z$ holds, then we get $(y+1) z>(z+1) x$, which is a contradiction. Similarly, we see that $yy$ ). First let $a$ be the largest integer satisfying $1 \leq a \leq n$ and $R(1, a-1) \leq 1$, and then choose the smallest integer $c$ satisfying $a \leq c \leq n$ and $R(c+1, n) \leq 1$. It is possible to choose such a pair $a, c$ since $R(1,0)=0$ and $R(n+1, n)=0$. If $a1$, while from the minimality of $c$, we must have $R(a+1, n)>1$. Then by splitting the grid into 2 rectangles by means of the horizontal line bordering the $a$-th row and the $a+1$-th row, we get the splitting contradicting the requirement of the problem. Thus, we must have $a=c$. Similarly, if for any pair of integers $x, y$ we define $C(x, y)$ to be the sum of the numbers inserted in all of the boxes whose column number is greater than or equal to $x$ and less than or equal to $y(C(x, y)=0$ if $x>y)$, then we get a number $b$ for which $$ C(1, b-1) \leq 1, \quad C(b+1, n) \leq 1, \quad 1 \leq b \leq n $$ If we let $r$ be the number inserted in the box whose row number is $a$ and the column number is $b$, then since $r \leq 1$, we conclude that the sum of the numbers inserted into all of the boxes is $$ \leq R(1, a-1)+R(a+1, n)+C(1, b-1)+C(b+1, n)+r \leq 5 $$ ## Problem 3. ## Solution For integers $a, b$ and a positive integer $m$, let us write $a \equiv b(\bmod m)$ if $a-b$ is divisible by $m$. Since $\frac{n^{p}+1}{p^{n}+1}$ must be a positive integer, we see that $p^{n} \leq n^{p}$ must hold. This means that if $p=2$, then $2^{n} \leq n^{2}$ must hold. As it is easy to show by induction that $2^{n}>n^{2}$ holds if $n \geq 5$, we conclude that if $p=2$, then $n \leq 4$ must be satisfied. And we can check that $(p, n)=(2,2),(2,4)$ satisfy the condition of the problem, while $(2,3)$ does not. Next, we consider the case where $p \geq 3$. Suppose $s$ is an integer satisfying $s \geq p$. If $s^{p} \leq p^{s}$ for such an $s$, then we have $$ \begin{aligned} (s+1)^{p} & =s^{p}\left(1+\frac{1}{s}\right)^{p} \leq p^{s}\left(1+\frac{1}{p}\right)^{p} \\ & =p^{s} \sum_{r=0}^{p}{ }_{p} C_{r} \frac{1}{p^{r}}p$, then $n^{p}A C$. Let $K$ be the point on the circle $\Gamma$ such that $A K$ is a diameter of this circle. Then, we get $$ \angle B C K=\angle A C K-\angle A C B=90^{\circ}-\angle A C B=\angle C B H $$ and $$ \angle C B K=\angle A B K-\angle A B C=90^{\circ}-\angle A B C=\angle B C H, $$ from which we conclude that the triangles $B C K$ and $C B H$ are congruent. Therefore, the quadrilateral $B K C H$ is a parallelogram, and its diagonal $H K$ passes through the center $M$ of the other diagonal $B C$. Therefore, the 3 points $H, M, K$ lie on the same straight line, and we have $\angle A E M=\angle A E K=90^{\circ}$. From $\angle A E D=90^{\circ}=\angle A D M$, we see that the 4 points $A, E, D, M$ lie on the circumference of the same circle, from which we obtain $\angle A M B=\angle A E D=$ $\angle A E F=\angle A C F$. Putting this fact together with the fact that $\angle A B M=\angle A F C$, we conclude that the triangles $A B M$ and $A F C$ are similar, and we get $\frac{A M}{B M}=\frac{A C}{F C}$. By a similar argument, we get that the triangles $A C M$ and $A F B$ are similar, and therefore, that $\frac{A M}{C M}=\frac{A B}{F B}$ holds. Noting that $B M=C M$, we also get $\frac{A C}{F C}=\frac{A B}{F B}$, from which we can conclude that $\frac{B F}{C F}=\frac{A B}{A C}$, proving the assertion of the problem. ## Problem 5. Solution: Let us note first that if $i \neq j$, then since $a_{i} a_{j} \leq \frac{a_{i}^{2}+a_{j}^{2}}{2}$, we have $$ n-a_{i} a_{j} \geq n-\frac{a_{i}^{2}+a_{j}^{2}}{2} \geq n-\frac{n}{2}=\frac{n}{2}>0 . $$ If we set $b_{i}=\left|a_{i}\right|(i=1,2, \ldots, n)$, then we get $b_{1}^{2}+b_{2}^{2}+\cdots+b_{n}^{2}=n$ and $\frac{1}{n-a_{i} a_{j}} \leq$ $\frac{1}{n-b_{i} b_{j}}$, which shows that it is enough to prove the assertion of the problem in the case where all of $a_{1}, a_{2}, \cdots, a_{n}$ are non-negative. Hence, we assume from now on that $a_{1}, a_{2}, \cdots, a_{n}$ are all non-negative. By multiplying by $n$ the both sides of the desired inequality we get the inequality: $$ \sum_{1 \leq i0, n-a_{j}^{2}>0$, we also get from the Cauchy-Schwarz inequality that $$ \left(\frac{a_{j}^{2}}{n-a_{i}^{2}}+\frac{a_{i}^{2}}{n-a_{j}^{2}}\right)\left(\left(n-a_{i}^{2}\right)+\left(n-a_{j}^{2}\right)\right) \geq\left(a_{i}+a_{j}\right)^{2}, $$ from which it follows that $$ \frac{\left(a_{i}+a_{j}\right)^{2}}{\left(n-a_{i}^{2}\right)+\left(n-a_{j}^{2}\right)} \leq\left(\frac{a_{j}^{2}}{n-a_{i}^{2}}+\frac{a_{i}^{2}}{n-a_{j}^{2}}\right) $$ holds. Combining the inequalities (ii) and (iii), we get $$ \begin{aligned} \sum_{1 \leq i