#include<stdio.h>
int main()
{
int n, i, a, j;
scanf("%d", &n);
for(i=1;i<=n;i++){
scanf("%d", &a);
if(a%8 == 3 || a%8 == 5 || a%8 == 0){
if(a%8 ==0){
for(j=1;j<=a/8;j++)printf("8");
printf("\n");
}else{
printf("%d", a%8);
for(j=1;j<=a/8;j++)printf("8");
printf("\n");
}
}else{
if(a<8){
printf("-1\n");
}else{
if(a%8==1)printf("333");
if(a%8==2)printf("55");
if(a%8==4)printf("3333");
if(a%8==6)printf("3335");
if(a%8==7)printf("555");
for(j=2;j<=a/8;j++)printf("8");
printf("\n");
}
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
784 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
784 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
784 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
65 ms |
784 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |