#include #include using namespace std; typedef long long LL; void MinusSinsu(LL N,int B) { if (N==0){ cout<<0< Q; string S; LL r,n=N; while (n!=0){ r=n%B; n=n/B; if (r<0){ n++; r-=B; } Q.push_back(r); } for (int i=(int)Q.size()-1;i>=0;i--){ cout<>T>>B; for (i=0;i>N; MinusSinsu(N,B); } return 0; }