#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int perfect(int num)
{
int sum = 0;
int k;
for(k=1;k<=num/2;k++)
{
if(num % k == 0)
sum += k;
}
if(num == sum)
return 1;
else
return 0;
}
int main()
{
int n,i,j;
int a,b,t;
int count;
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d %d",&a,&b);
if(a > b) //!!
{
t = a;
a = b;
b = t;
}
count = 0;
for(j=a;j<=b;j++)
{
if(perfect(j) == 1)
count++;
}
printf("%d/n",count);
}
return 0;
}