Back to the Problem
Compute the gcd with Euclid's algorithm and compare with 1.
Complexity: O(log min(A, B))