Submission
Status:
----------
Subtask/Task Score:
0/100
Score: 0
User: matcherbrainner
Problemset: บริษัททำความสะอาด
Language: cpp
Time: 0.004 second
Submitted On: 2026-10-09 09:29:47
#include<bits/stdc++.h>
using namespace std;
void solve(int n){
if(n==0){cout<<"0";return;}
bool f=true;
while(n!=0){
int r=n%5;
if(r<0)r+=5;
if(r>2)r-=5;
cout<<(f?"":" ")<<r;
f=false;
n=(n-r)/5;
}
cout<<"\n";
}
int main(){
int k;
cin>>k;
while(k--){
int u;
cin>>u;
solve(u);
}
}