Problem: Marbles
Here is the problem statement
Marbles
Despite multiple attempts, I get a WA. Can someone please tell me the mistake or give me some test cases to figure out the bug in my code.
Here’s my solution
My code
Problem: Marbles
Here is the problem statement
Marbles
Despite multiple attempts, I get a WA. Can someone please tell me the mistake or give me some test cases to figure out the bug in my code.
Here’s my solution
My code
I saw your code,

# cook your dish here
for _ in range(int(input())):
a,b = map(int,input().split())
c,d = a,b
count1,count2 = 0,0
while (a%b) and a>=1:
a+=1
b-=1
count1+=1
while c%d and c>=1:
c-=1
d+=1
count2+=1
if (count1<count2 and a%b==0) or c==0:
print(count1)
else:
print(count2)
Got it. Thanks