In ancient Egypt, fractions were written as sums of fractions with numerator 1. For instance,$ \frac{3}{5}=\frac{1}{2}+\frac{1}{10}$. Consider the following algorithm for writing a fraction $\frac{m}{n}$ in this form$(1\leq m < n)$: write the fraction $\frac{1}{\lceil n/m\rceil}$ , calculate the fraction $\frac{m}{n}-\frac{1}{\lceil n/m \rceil}$ , and if it is nonzero repeat the same step. Prove that this algorithm always finishes in a finite number of steps.
Note:if $ n\in \mathbf{Z} $ and $n-1<x\leq n , \lceil x\rceil=n$