Result: Accepted
Time: 65ms
Memory: 2132kB
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
using namespace std;
const int maxn = 100010;
const int inf = 0x3f3f3f3f;
int n,m,k,t;
int a[maxn];
string s;
int main(){
scanf("%d %d",&n,&k);
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(int i=0;i<n;i++){
for(int j=0;j<k;j++){
m=(int)ceil(sqrt(a[i]))*10;
if(a[i]==m) break;
else a[i]=m;
}
}
for(int i=0;i<n;i++){
if(i==n-1) printf("%d\n",a[i]);
else printf("%d ",a[i]);
}
}