简单题。
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<vector>
using namespace std; int s[],tot;
int n,b; bool check()
{
for(int i=; i<=tot/; i++)
{
if(s[i]!=s[tot-i-]) return ;
}
return ;
} int main()
{
scanf("%d%d",&n,&b);
if(n==)
{
printf("Yes\n");
printf("0\n");
}
else
{
tot=;
while(n) s[tot++]=n%b,n=n/b;
if(check()) printf("Yes\n");
else printf("No\n");
for(int i=tot-; i>=; i--)
{
printf("%d",s[i]);
if(i>) printf(" ");
else printf("\n");
}
}
return ;
}