Example 6 Divide a rectangle with side lengths of positive integers $m, n$ into several squares with side lengths of positive integers, with each square's sides parallel to the corresponding sides of the rectangle. Try to find the minimum value of the sum of one side length of these squares. (2001 National High School League Exam Question)
Let's assume $m \geqslant n$, and denote the minimum value of the required side length as $f(m, n)$. By the Euclidean algorithm, there exist positive integers $q_{1}$, $q_{2}, \cdots, q_{k+1}$ and $r_{1}, r_{2}, \cdots, r_{k}$ satisfying $m=q_{1} n+r_{1}\left(0m+n-(m, n)$. If $a_{1}=n$, then after dividing a $m \times n$ rectangle into a square with side length $a_{1}=n$, the remaining part can form a $(m-n) \times n$ rectangle, which is divided into $p-1$ squares with side lengths $a_{2}, a_{3}, \cdots, a_{p}$. By the induction hypothesis, we have $a_{2}+a_{3}+\cdots+a_{p} \geqslant(m-n)+n-(m-n, n)=$ $m-(m, n)$. Therefore, $b_{m \cdot n}=a_{1}+a_{2}+\cdots+a_{p} \geqslant m+n-(m, n)$. Thus, $f(m, n)=\min b_{m, n} \geqslant$ $m+n-(m, n)$. In summary, the minimum value of the sum of the side lengths of the squares is $f(m, n)=m+n-(m, n)$.