solve pie
solve extended_euclid