Euclid's Algorithm and the Least-Remainder Algorithm