My code matches several of the accepted solution still it was giving wrong answer
/* 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
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t>0)
{
int a=sc.nextInt();
int b=sc.nextInt();
a–;
b–;
int m=0,c=0;
if(a>b)
m=a-b;
else
m=b-a;
int i=0;
for(i=1;ii<=m;i++)
if(m%i==0)
c++;
if(m/i!=i)
c++;
System.out.println(c);
t--;
}
}
}