#include<iostream>
#include<list>
#include<string>
#include<cstring>
#include<sstream>
#include<cctype>
#include<string.h>
#include<algorithm>
#include<cmath>
#include<stack>
#include<fstream>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
#include<queue>
using namespace std;
int main()
{
long long a,b,c,d,ans;
while(cin>>a>>b)
{
if(!a && !b) break;
c=abs(a-b);
d=sqrt(c);
ans=0;
for(int i=1;i<=d;i++)
if(c%i==0)
ans+=2;
if(d*d==c)
ans--;
cout<<ans<<endl;
}
return 0;
}
No comments:
Post a Comment