Result: Accepted
Time: 54ms
Memory: 1092kB
#include<stdio.h>
int f(int x)
{
if(x==1)
return 10;
else if(x<=4)
return 20;
else if(x<=9)
return 30;
else if(x<=16)
return 40;
else if(x<=25)
return 50;
else if(x<=36)
return 60;
else if(x<=49)
return 70;
else if(x<=64)
return 80;
else if(x<=81)
return 90;
else
return 100;
}
int main()
{
int n,k,ai,i;
scanf("%d%d",&n,&k);
if(k>=5)
{
for(i=1;i<n;i++)
printf("100 ");
printf("100");
return 0;
}
while(n--)
{
scanf("%d",&ai);
for(i=1;i<=k;i++)
ai=f(ai);
if(!n)
printf("%d\n",ai);
else
printf("%d ",ai);
}
}