..jsu 5:
#include<stdio.h>
int main()
{
int n,a,b,i,j,s,num,t;
scanf("%d",&n);
while(n--)
{num=0;
scanf("%d%d",&a,&b);
if(a>b)
{t=a;a=b;b=t;}
for(i=a;i<=b;i++)
{s=0;
for(j=1;j<=i;j++)
{
if(i%j==0)
s=s+j;
if(s==i&&j==i-1)
num++;
}
}
printf("%d\n",num);
}
return 0;
}