# include <iostream>
using namespace std;
void main()
{
int n,m,N;
cin>>N;
while(N > 0)
{
int k=1;
while(cin>>n>>m && (n||m))
{
int count=0;
for(int i=1;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
if((i*i+j*j+m)%(i*j)==0)
count++;
}
}
cout<<"Case "<<k++<<": "<<count<<endl;
}
N--;
if(N!=0)
cout<<endl;
}
}
hdoj1017简单题
最新推荐文章于 2024-08-01 16:02:51 发布