C3. Let $X Y Z$ be an acute-angled triangle. Let $s$ be the side-length of the square which has two adjacent vertices on side $Y Z$, one vertex on side $X Y$ and one vertex on side $X Z$. Let $h$ be the distance from $X$ to the side $Y Z$ and let $b$ be the distance from $Y$ to $Z$.
(a) If the vertices have coordinates $X=(2,4), Y=(0,0)$ and $Z=(4,0)$, find $b, h$ and $s$.
(b) Given the height $h=3$ and $s=2$, find the base $b$.
(c) If the area of the square is 2017 , determine the minimum area of triangle $X Y Z$.
Solution: Subtracting coordinates of corresponding points we have $b=z_{1}-y_{1}=4-0=4$, $h=x_{2}-y_{2}=x_{2}-z_{2}=4-0=4$. Note that points $(1,2)$ and $(3,2)$ lie on sides $X Y$ and $X Z$ respectively and together with points $(1,0)$ and $(3,0)$ they define a square that satisfies the conditions of the problem. This square has side $s=2$. (Alternatively, from similar triangles we have $\frac{s}{b}=\frac{h-s}{h}$ that is $\frac{s}{4}=\frac{4-s}{4}$, so $s=2$.)
The answer is $b=4, \quad h=4, \quad s=2$.
Solution: Since $P Q$ is parallel to $Y Z$, triangle $X P Q$ is similar to $X Y Z$. Because $h=3$ and corresponding height of $X P Q$ is $3-2=1$, we conclude that the base of $X Y Z$ is $3 \times 2=6$. The answer is $b=6$.
Solution 1: From the similarity of $X P Q$ and $X Y Z$ we have $\frac{s}{b}=\frac{h-s}{h}$. Equivalently, $s=\frac{b h}{b+h}$. Thus, $s^{2}=\frac{(b h)^{2}}{(b+h)^{2}}=2 K \frac{b h}{(b+h)^{2}}$. Here $K=\frac{b h}{2}$ is the area of $X Y Z$.
By AM-GM inequality (arithmetic mean is greater or equal than geometric mean), we have $\frac{4 b h}{(b+h)^{2}} \leq 1$, thus $s^{2} \leq \frac{K}{2}$.
We have $2017 \leq \frac{K}{2}$. Thus, $4034 \leq K$.
Now, we show that the minimum area is achieved for $b=h=2 s=2 \sqrt{2017}$. Indeed, if $b=h$ then $s=\frac{b h}{b+h}=\frac{b}{2}=\frac{h}{2}$ and $K=2 s^{2}=4034$.
The minimum value for the area of $X Y Z$ is 4034 .
The answer is 4034 .
Solution 2: From the similarity of $X P Q$ and $X Y Z$ we have $\frac{s}{b}=\frac{h-s}{h}$. Thus $b=\frac{s h}{h-s}$. The area
$$
[X Y Z]=\frac{b h}{2}=\frac{h^{2} s}{2(h-s)} .
$$

Finding the minimum value of this expression is equivalent to finding the maximum of its reciprocal $\frac{2(h-s)}{h^{2} s} \rightarrow \max$.
Now, note that the reciprocal is a quadratic function in the variable $\frac{1}{h}$, that is
$$
\frac{2(h-s)}{h^{2} s}=-2\left(\frac{1}{h}\right)^{2}+\frac{2}{s}\left(\frac{1}{h}\right),
$$
so the maximum is achieved at $\frac{1}{h}=\frac{1}{2} \cdot \frac{1}{s}$ or equivalently, for $h=2 s$.
Then $b=2 s$ and the area $[X Y Z]=2 s^{2}=4034$.