Question: # python3 def gcd_naive(a, b): assert 1
# python3 def gcd_naive(a, b): assert 1 <= a <= 2 * 10 ** 9 and 1 <= b <= 2 * 10 ** 9 for divisor in range(min(a, b), 0, -1): if a % divisor == 0 and b % divisor == 0: return divisor assert False def gcd(a, b): assert 0 <= a <= 2 * 10 ** 9 and 0 <= b <= 2 * 10 ** 9 # START CODE HERE # END CODE HERE if __name__ == '__main__': input_a, input_b = map(int, input().split()) print(gcd(input_a, input_b))
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
