(Application of the algorithm)

Find the GCD $d$ of the integers 663 and 182 and integers $u, v \in \mathbb{Z}$ such that $d=663 u+182 v$.
Let's apply the 2-step algorithm. First, we set $a=182$ (the smaller of the two numbers) and $b=663$ (the larger).

Step $0: a_{0}=b=663, a_{1}=a=182, u_{0}=v_{1}=0$ and $v_{0}=u_{1}=1$

Step 1: $a_{0}=663=3 \times 182+117$ so we set $a_{2}=117$. With $q=3$, we apply the formula of the algorithm to find $u_{2}=u_{0}-q u_{1}=-3$ and $v_{2}=v_{0}-q v_{1}=1$.

Step 2: $a_{1}=182=1 \times 117+65$. We set $a_{3}=65, q=1, u_{3}=u_{1}-q u_{2}=4$ and $v_{3}=v_{1}-q v_{2}=-1$.

Step $3: a_{2}=117=1 \times 65+52$. We set $a_{4}=52, q=1, u_{4}=u_{2}-q u_{3}=-7$ and $v_{4}=v_{2}-q v_{3}=2$.

Step $4: a_{3}=65=1 \times 52+13$. We set $a_{5}=13, q=1, u_{5}=u_{3}-q u_{4}=11$ and $v_{5}=v_{3}-q v_{4}=-3$.

Step 5: $a_{4}=52=4 \times 13+0$. Since $a_{6}=0$, we have found the GCD $d=a_{5}=13$ and we know that it can be written as

$$
13=d=a_{5}=a u_{5}+b v_{5}=11 \times 182-3 \times 663
$$

Thus, $d=13$ and the solution pair $(u, v)=(11,-3)$.