HDOJ 1017
充满各种PE的垃圾题
#include <iostream>
#include <iostream>
using namespace std;
int n,m;
static int c=0;
int round;
int main()
{
cin>>round;
for(int l=0;l<round;l++)
{
c=0;
while(cin>>n>>m)
{
if(n==0&&m==0) break;
int tot=0;
int ans;
for(int i=1;i<n;i++)
for(int j=i+1;j<n;j++)
{
ans=(i*i+j*j+m)%(i*j);
if(ans==0)
tot++;
//cout<<i<<" "<<j<<endl;
}
cout<<"Case "<<++c<<": "<<tot<<endl;
}
if(l!=round-1)
cout<<endl;
}
return 0;
}