In Python, the math module contains a number of mathematical operations that can be performed fairly quickly. The built-in function math.gcd(a, b), which calculates the GCD of any two integersnumbers. Can be used from version 3.5.
math.gcd(a, b),
solve(A)
n
A
1000 ms 256 Mb Rules for program design and list of errors in automatic problem checking