Showing wrong answers for correct output


#1

For Input
A: 64
B: 6
I am getting correct output when I run using custom input i.e.
16

but I am getting Wrong answer while submitting. Judge says code returns
1
while the expected output is
16

I think there is a conflict with global variable, Can you please check what the issue is?


#2

In your answer:
gcd(16, 6) = 2, where X = 16, B = 6
The problems says we want gcd(X, B) = 1