add extended_gcd.cpp and improve the code