problem: Each of eight boxes contains six balls. Each ball has been colored with one of $n$ colors, such that no two balls in the same box are the same color, and no two colors occur together in more than one box. Find with proof the smallest possible $n$.

solution: The answer is $n=23$. Shown below is a construction using that many colors, which we call $\{1,2, \ldots, 15, a, \ldots, f, X, Y\}$.  $$ \left[\begin{array}{cccccccc} X & X & X & 1 & 2 & 3 & 4 & 5 \\ 1 & 6 & 11 & 6 & 7 & 8 & 9 & 10 \\ 2 & 7 & 12 & 11 & 12 & 13 & 14 & 15 \\ 3 & 8 & 13 & Y & Y & Y & a & b \\ 4 & 9 & 14 & a & c & e & c & d \\ 5 & 10 & 15 & b & d & f & e & f \end{array}\right] $$ I First solution (hands-on). We say a color $x$ is overrated if it is used at least three times. First we make the following smoothing argument.  Claim - Suppose some box contains a ball of overrated color $x$ plus a ball of color $y$ used only once. Then we can change one ball of color $x$ to color $y$ while preserving all the conditions.  By applying this operation as many times as possible, we arrive at a situation in which whenever we have a box with an overrated color, the other colors in the box are used twice or more.  Assume now $n \leq 23$ and the assumption; we will show the equality case must of the form we gave. Since there are a total of 48 balls, at least two colors are overrated. Let $X$ be an overrated color and take three boxes where it appears. Then there are 15 more distinct colors, say $\{1, \ldots, 15\}$ lying in those boxes. Each of them must appear at least once more, so we arrive at the situation  $$ \left[\begin{array}{cccccccc} X & X & X & 1 & 2 & 3 & 4 & 5 \\ 1 & 6 & 11 & 6 & 7 & 8 & 9 & 10 \\ 2 & 7 & 12 & 11 & 12 & 13 & 14 & 15 \\ 3 & 8 & 13 & & & & & \\ 4 & 9 & 14 & & & & & \\ 5 & 10 & 15 & & & & & \end{array}\right] $$  up to harmless permutation of the color names. Now, note that none of these 15 colors can reappear. So it remains to fill up the last five boxes.  Now, there is at least one more overrated color, distinct from any we have seen; call it $Y$. In the three boxes $Y$ appears in, there must be six new colors, and this gives the lower bound $n \geq 1+15+1+6=23$ which we sought, with equality occurring as we saw above.  Remark (Partial progresses). The fact that $\binom{16}{2}=120=8\binom{6}{2}$ (suggesting the bound $n \geq 16$ ) is misleading and not that helpful.  There is a simple argument showing that $n$ should be much larger than 16. Imagine opening the boxes in any order. The first box must contain six new colors. The second box must contain five new colors, and so on; thus $n \geq 6+5+4+3+2+1=21$. This is sharp for seven boxes, as the example below shows.  $$ \left[\begin{array}{ccccccc} 1 & 1 & 2 & 3 & 4 & 5 & 6 \\ 2 & 7 & 7 & 8 & 9 & 10 & 11 \\ 3 & 8 & 12 & 12 & 13 & 14 & 15 \\ 4 & 9 & 13 & 16 & 16 & 17 & 18 \\ 5 & 10 & 14 & 17 & 19 & 19 & 20 \\ 6 & 11 & 15 & 18 & 20 & 21 & 21 \end{array}\right] $$  However, one cannot add an eight box, suggesting the answer should be a little larger than 21. One possible eight box is $\{1,12,19, a, b, c\}$ which gives $n \leq 24$; but the true answer is a little trickier.


solution: The answer is $n=23$. Shown below is a construction using that many colors, which we call $\{1,2, \ldots, 15, a, \ldots, f, X, Y\}$.  $$ \left[\begin{array}{cccccccc} X & X & X & 1 & 2 & 3 & 4 & 5 \\ 1 & 6 & 11 & 6 & 7 & 8 & 9 & 10 \\ 2 & 7 & 12 & 11 & 12 & 13 & 14 & 15 \\ 3 & 8 & 13 & Y & Y & Y & a & b \\ 4 & 9 & 14 & a & c & e & c & d \\ 5 & 10 & 15 & b & d & f & e & f \end{array}\right] $$ 【I Second solution (slick). Here is a short proof from the official solutions of the bound. Consider the $8 \times 6$ grid of colors as before. For each ball $b$, count the number of times $n_{b}$ its color is used, and write the fraction $\frac{1}{n_{b}}$.  On the one hand, we should have  $$ n=\sum_{\text {all } 48 \text { balls } b} \frac{1}{n_{b}} $$  On the other hand, for any given box $B$, we have $\sum_{b \in B}\left(n_{b}-1\right) \leq 7$, as among the other seven boxes at most one color from $B$ appears. Therefore, $\sum_{b \in B} n_{b} \leq 13$, and a smoothing argument this implies  $$ \sum_{b \in B} \frac{1}{n_{b}} \geq \frac{1}{3} \cdot 1+\frac{1}{2} \cdot 5=\frac{17}{6} $$  Thus, $n \geq 8 \cdot \frac{17}{6}=22.66 \ldots$, so $n \geq 23$.


problem: Let $A B C$ be a triangle and let $\omega$ be its incircle. Denote by $D_{1}$ and $E_{1}$ the points where $\omega$ is tangent to sides $B C$ and $A C$, respectively. Denote by $D_{2}$ and $E_{2}$ the points on sides $B C$ and $A C$, respectively, such that $C D_{2}=B D_{1}$ and $C E_{2}=A E_{1}$, and denote by $P$ the point of intersection of segments $A D_{2}$ and $B E_{2}$. Circle $\omega$ intersects segment $A D_{2}$ at two points, the closer of which to the vertex $A$ is denoted by $Q$. Prove that $A Q=D_{2} P$.

solution: We have that $P$ is the Nagel point  $$ P=(s-a: s-b: s-c) . $$  Therefore,  $$ \frac{P D_{2}}{A D_{2}}=\frac{s-a}{(s-a)+(s-b)+(s-c)}=\frac{s-a}{s} . $$  Meanwhile, $Q$ is the antipode of $D_{1}$. The classical homothety at $A$ mapping $Q$ to $D_{1}$ (by mapping the incircle to the $A$-excircle) has ratio $\frac{s-a}{s}$ as well (by considering the length of the tangents from $A$ ), so we are done.


problem: Let $a, b, c$ be nonnegative real numbers such that $a^{2}+b^{2}+c^{2}+a b c=4$. Show that  $$ 0 \leq a b+b c+c a-a b c \leq 2 $$

solution: $  The left-hand side of the inequality is trivial; just note that $\min \{a, b, c\} \leq 1$. Hence, we focus on the right side. We use Lagrange Multipliers.  Define  $$ U=\left\{(a, b, c) \mid a, b, c>0 \text { and } a^{2}+b^{2}+c^{2}<1000\right\} . $$  This is an intersection of open sets, so it is open. Its closure is  $$ \bar{U}=\left\{(a, b, c) \mid a, b, c \geq 0 \text { and } a^{2}+b^{2}+c^{2} \leq 1000\right\} . $$  Hence the constraint set  $$ \bar{S}=\{\mathbf{x} \in \bar{U}: g(\bar{x})=4\} $$  is compact, where $g(a, b, c)=a^{2}+b^{2}+c^{2}+a b c$. Define  $$ f(a, b, c)=a^{2}+b^{2}+c^{2}+a b+b c+c a $$  It's equivalent to show that $f \leq 6$ subject to $g$. Over $\bar{S}$, it must achieve a global maximum. Now we consider two cases.  If $\mathbf{x}$ lies on the boundary, that means one of the components is zero (since $a^{2}+b^{2}+c^{2}=$ 1000 is clearly impossible). WLOG $c=0$, then we wish to show $a^{2}+b^{2}+a b \leq 6$ for $a^{2}+b^{2}=4$, which is trivial.  Now for the interior $U$, we may use the method of Lagrange Multipliers. Consider a local maximum $\mathbf{x} \in U$. Compute  $$ \nabla f=\langle 2 a+b+c, 2 b+c+a, 2 c+a+b\rangle $$  and  $$ \nabla g=\langle 2 a+b c, 2 b+c a, 2 c+a b\rangle $$  Of course, $\nabla g \neq \mathbf{0}$ everywhere, so introducing our multiplier yields  $$ \langle 2 a+b+c, a+2 b+c, a+b+2 c\rangle=\lambda\langle 2 a+b c, 2 b+c a, 2 c+a b\rangle . $$  Note that $\lambda \neq 0$ since $a, b, c>0$. Subtracting $2 a+b+c=\lambda(2 a+b c)$ from $a+2 b+c=$ $\lambda(2 b+c a)$ implies that  $$ (a-b)([2 \lambda-1]-\lambda c)=0 . $$  We can derive similar equations for the others. Hence, we have three cases.  1. If $a=b=c$, then $a=b=c=1$, and this satisfies $f(1,1,1) \leq 6$. 2. If $a, b, c$ are pairwise distinct, then we derive $a=b=c=2-\lambda^{-1}$, contradiction. 3. Now suppose that $a=b \neq c$.  Meanwhile, the constraint (with $a=b$ ) reads  $$ \begin{aligned} a^{2}+b^{2}+c^{2}+a b c=4 & \Longleftrightarrow c^{2}+a^{2} c+\left(2 a^{2}-4\right)=0 \\ & \Longleftrightarrow(c+2)\left(c-\left(2-a^{2}\right)\right)=0 \end{aligned} $$  which since $c>0$ gives $c=2-a^{2}$. Noah Walsh points out that at this point, we don't need to calculate the critical point; we just directly substitute $a=b$ and $c=2-a^{2}$ into the desired inequality:  $$ a^{2}+2 a(2-a)^{2}-a^{2}(2-a)^{2}=2-(a-1)^{2}\left(a^{2}-4 a+2\right) \leq 0 $$  So any point here satisfies the inequality anyways.  Remark. It can actually be shown that the critical point in the third case we skipped is pretty close: it is given by  $$ a=b=\frac{1+\sqrt{17}}{4} \quad c=\frac{1}{8}(7-\sqrt{17}) . $$  This satisfies  $$ f(a, b, c)=3 a^{2}+2 a c+c^{2}=\frac{1}{32}(121+17 \sqrt{17}) \approx 5.97165 $$  which is just a bit less than 6 .  Remark. Equality holds for the upper bound if $(a, b, c)=(1,1,1)$ or $(a, b, c)=(\sqrt{2}, \sqrt{2}, 0)$ and permutations. The lower bound is achieved if $(a, b, c)=(2,0,0)$ and permutations.


problem: Let $A B C$ be a triangle and $P$ any point such that $P A, P B, P C$ are the sides of an obtuse triangle, with $P A$ the longest side. Prove that $\angle B A C$ is acute.

solution: Using Ptolemy's inequality and Cauchy-Schwarz,  $$ \begin{aligned} P A \cdot B C & \leq P B \cdot A C+P C \cdot A B \\ & \leq \sqrt{\left(P B^{2}+P C^{2}\right)\left(A B^{2}+A C^{2}\right)} \\ & <\sqrt{P A^{2} \cdot\left(A B^{2}+A C\right)^{2}}=P A \cdot \sqrt{A B^{2}+A C^{2}} \end{aligned} $$  meaning $B C^{2}<A B^{2}+A C^{2}$, so $\angle B A C$ is acute.  $$ A B^{2}+B P^{2}+P C^{2}+C A^{2}=A P^{2}+B C^{2}+4 M N^{2} \geq A P^{2}+B C^{2} $$  We are given that $A P^{2}>B P^{2}+P C^{2}$, so $A B^{2}+A C^{2}>B C^{2}$, and we get $\angle B A C$ is acute.


problem: Let $S \subseteq \mathbb{Z}$ be such that: (a) there exist $a, b \in S$ with $\operatorname{gcd}(a, b)=\operatorname{gcd}(a-2, b-2)=1$; (b) if $x$ and $y$ are elements of $S$ (possibly equal), then $x^{2}-y$ also belongs to $S$. Prove that $S=\mathbb{Z}$.

solution: Call an integer $d>0$ shifty if $S=S+d$ (meaning $S$ is invariant under shifting by $d$ ). First, note that if $u, v \in S$, then for any $x \in S$,  $$ v^{2}-\left(u^{2}-x\right)=\left(v^{2}-u^{2}\right)+x \in S $$  Since we can easily check that $|S|>1$ and $S \neq\{n,-n\}$ we conclude there exists a shifty integer.  We claim 1 is shifty, which implies the problem. Assume for contradiction that 1 is not shifty. Then for GCD reasons the set of shifty integers must be $d \mathbb{Z}$ for some $d \geq 2$.  Claim - We have $S \subseteq\left\{x: x^{2} \equiv m(\bmod d)\right\}$ for some fixed $m$.  Now take $a, b \in S$ as in (a). In that case we need to have  $$ a^{2} \equiv b^{2} \equiv\left(a^{2}-a\right)^{2} \equiv\left(b^{2}-b\right)^{2} \quad(\bmod d) $$  Passing to a prime $p \mid d$, we have the following:  - Since $a^{2} \equiv\left(a^{2}-a\right)^{2}(\bmod p)$ or equivalently $a^{3}(a-2) \equiv 0(\bmod p)$, either $a \equiv 0$ $(\bmod p)$ or $a \equiv 2(\bmod p)$. - Similarly, either $b \equiv 0(\bmod p)$ or $b \equiv 2(\bmod p)$. - Since $a^{2} \equiv b^{2}(\bmod p)$, or $a \equiv \pm b(\bmod p)$, we find either $a \equiv b \equiv 0(\bmod p)$ or $a \equiv b \equiv 2(\bmod p)($ even if $p=2)$.  This is a contradiction. Remark. The condition (a) cannot be dropped, since otherwise we may take $S=\{2(\bmod p)\}$ or $S=\{0(\bmod p)\}$, say.


problem: Each point in the plane is assigned a real number. Suppose that for any nondegenerate triangle, the number at its incenter is the arithmetic mean of the three numbers at its vertices. Prove that all points in the plane are equal to each other.

solution: First, we claim that in an isosceles trapezoid $A B C D$ we have $a+c=b+d$. Indeed, suppose WLOG that rays $B A$ and $C D$ meet at $X$. Then triangles $X A C$ and $X B D$ share an incircle, proving the claim.  Now, given any two points $A$ and $B$, construct regular pentagon $A B C D E$. We have $a+c=b+d=c+e=d+a=e+b$, so $a=b=c=d=e$.