#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1376 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1376 KB |
Output isn't correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
1376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
229 ms |
1376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |