Help me in solving MODULO3 problem

My issue

I am not sure why even the if the desired output comes when I am running the program the system is showing the wrong answer

My code

/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc=new Scanner(System.in);
		int T=sc.nextInt();
		if(T>0 && T<10001){
		    int A[]=new int[T];
		    int B[]=new int[T];
		    for(int i=0;i<T;i++){
		      A[i]=sc.nextInt();
		      B[i]=sc.nextInt();
		  }
		  for(int i=0;i<T;i++){
		      int c=0;
		      while(0==0){
		      if(A[i]%3==0 || B[i]%3==0){
		      System.out.println(c);
		      break;
		      }
		          A[i]=A[i]-B[i];
		          c=c+1;
		      }
		  }
	  }
	}
}

Problem Link: MODULO3 Problem - CodeChef

@durgesh34
Your logic is not right.
The logic is if A%3==0 or B%3==0 then print 0;
else print the absolute difference of (A%3 and B%3 )+1