#include <stdio.h>
int main() {
int number,radix,digit[32];
scanf("%d%d",&number,&radix);
int res=number,i;
for (i = 0;; ++i) {
digit[i]=res%radix;
res/=radix;
if(res==0)
break;
}
int j;
for (j=0;j<=i/2;j++){
if(digit[j]!=digit[i-j]) {
puts("No");
break;
}
}
if(j>i/2)
puts("Yes");
for(;i>0;i--){
printf("%d ",digit[i]);
}
printf("%d\n",digit[0]);
return 0;
}
网友评论