4. Let $H$ be the foot of the altitude from vertex $C$ in triangle $\triangle A B C$. Let $R$ and $S$ be the points where the incircles of triangles $\triangle A H C$ and $\triangle B C H$ touch $\overline{C H}$, respectively. If $|A B|=2018$, $|A C|=2017$, and $|B C|=2016$, calculate $|R S|$.
4. 

![](https://cdn.mathpix.com/cropped/2024_05_30_8091e4f2781742023a76g-20.jpg?height=720&width=836&top_left_y=1402&top_left_x=290)

Let $T_{1}$ be the point of tangency of the incircle of triangle $\triangle A H C$ and side $\overline{A C}$, and $T_{2}$ be the point of tangency of the incircle of triangle $\triangle A H C$ and side $\overline{A H}$.

Consider the right triangles $\triangle A S_{1} T_{1}$ and $\triangle A T_{2} S_{1}$. They have a common hypotenuse $\overline{A S_{1}}$, congruent right angles $\angle S_{1} T_{1} A \cong \angle A T_{2} S_{1}$, and equal side lengths $\left|S_{1} T_{1}\right|=\left|S_{1} T_{2}\right|$.

Therefore, triangles $\triangle A S_{1} T_{1}$ and $\Delta A T_{2} S_{1}$ are congruent by the SSS theorem ${ }^{>}$, so $\left|A T_{1}\right|=\left|A T_{2}\right|$.

Consider the right triangles $\Delta C T_{1} S_{1}$ and $\Delta C S_{1} R$. They have a common hypotenuse $\overline{C S_{1}}$, congruent right angles $\angle C T_{1} S_{1} \cong \angle S_{1} R C$, and equal side lengths $\left|S_{1} T_{1}\right|=\left|S_{1} R\right|$.

Therefore, triangles $\Delta C T_{1} S_{1}$ and $\Delta C S_{1} R$ are congruent by the SSS theorem ${ }^{>}$, so $\left|T_{1} C\right|=|R C|$.

Then, $\left|T_{2} H\right|=|R H|$ because both lengths are radii of the same circle.

Now we have

$|A C|=\left|A T_{1}\right|+\left|T_{1} C\right|=\left|A T_{2}\right|+|R C|=|A H|-\left|T_{2} H\right|+|C H|-|R H|=|A H|+|C H|-2|R H|$.

From this, it follows that

$|R H|=\frac{1}{2} \cdot(|A H|+|C H|-|A C|)=\frac{1}{2} \cdot(|A H|+|C H|-2017)$.

Similarly, using $T_{3}$ and $T_{4}$, we get

$|S H|=\frac{1}{2} \cdot(|B H|+|C H|-|B C|)=\frac{1}{2} \cdot(|B H|+|C H|-2016)$.

By the Pythagorean theorem, we have

$2017^{2}-|A H|^{2}=|C H|^{2}=2016^{2}-|B H|^{2}$,

from which it follows that

$|A H|^{2}-|B H|^{2}=2017^{2}-2016^{2}$,

or

$|A H|-|B H|=\frac{2017^{2}-2016^{2}}{|A H|+|B H|}=\frac{(2017-2016)(2017+2016)}{|A B|}=\frac{4033}{2018}$.

Finally, from (1), (2), and (3), we get

$|R S|=|R H|-|S H|=\frac{1}{2} \cdot(|A H|-|B H|-1)=\frac{1}{2} \cdot\left(\frac{4033}{2018}-1\right)=\frac{2015}{4036}$.