use fast Abhinav Baid n_gcd()