You are viewing a single comment's thread. Return to all comments →
Thanks for trying
int main(){
int t; cin >> t; for(int a0 = 0; a0 < t; a0++){ int n, y, z, flag = -1; cin >> n; z = n; if(z <= 0) cout<<"-1\n"; else { if(z%3 == 0) { cout<< string(z,'5')<<"\n"; } while(z%3 != 0) { z -= 5; if(z<0) { cout<<"-1\n"; break; } else { cout<<string(z,'5')<<string((n-z),'3')<<"\n";; } } } } return 0;
}
This is what i ment exactly, but still not working for large inputs :(
Seems like cookies are disabled on this browser, please enable them to open this website
Sherlock and The Beast
You are viewing a single comment's thread. Return to all comments →
Thanks for trying
int main(){
}
This is what i ment exactly, but still not working for large inputs :(