ユークリッドの互除法
The extended Euclidean algorithm proceeds similarly, but adds two other sequences, as follows