Here’s the code…
/*NUKES*/
#include<stdio.h>
int main(void)
{
unsigned long long a,n,k;
unsigned int arr[105]={0};
unsigned int i=0,j;
scanf("%llu%llu%llu",&a,&n,&k);
while(a)
{
arr[i++] = a%(n+1);
a/=(n+1);
}
for(j=0;j<k;j++)
{
if(j!=(k-1))
printf("%u ",arr[j]);
else
printf("%u",arr[j]);
}
printf("\n");
return 0;
}