int n;
scanf(“%d”,&n);
for(int j=1;j<=n;j++)
{
int num =0;
scanf("%d",&num);
int sum =0;
for(int i =1;i*i<=num;i++) //对应i*i<=num
{
if(num%i==0){
if(i<num)
sum+=i;
if(num/i!=i&&num/i<num)
sum += num/i;
}
}
if(sum==num)
printf("%d is perfect\n",num);
else
printf("%d is not perfect\n",num);
}
//
//if(num%i==0){
// if(i<num)
// sum+=i;
// if(i/num!=num&&num/i<num)
// sum += num/i;
//对应不同情况,一个是36,一个是1.