Submission #2348

#TimeUsernameProblemLanguageResultExecution timeMemory
2348ldj5098생일수 I (GA4_birthday1)C++98
0 / 100
229 ms1376 KiB
#include<iostream> #include<stdio.h> #include<stdlib.h> using namespace std; int main() { int n, i, j, c, v, b, na, a; cin >> n; for(i=1;i<=n;i++){ na=0; cin >> a; c=a/8; na=a%8; v=na/5; na=na%5; b=na/3; na=na%3; if(na>=1){ if(a%8==0){ for(j=1;j<=a/8;j++)cout << "8"; cout << endl; } if(a%5==0){ for(j=1;j<=a/5;j++)cout << "5"; cout << endl; } if(a%3==0){ for(j=1;j<=a/3;j++)cout << "3"; cout << endl; } else cout << "-1" << endl; } else{ for(j=1;j<=b;j++)cout << "3"; for(j=1;j<=v;j++)cout << "5"; for(j=1;j<=c;j++)cout << "8"; cout << endl; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...