fork(2) download
#include <iostream>
using namespace std;

int main() {
	// your code goes here
	int a, n, k;
	cin>>a>>n>>k;
	while(k--) {
		cout<<a%(n+1)<<" "; a=a/(n+1);
	}
	return 0;
}
Success #stdin #stdout 0s 3300KB
stdin
25 4 4
stdout
0 0 1 0