Submission #1917

#TimeUsernameProblemLanguageResultExecution timeMemory
1917gs13105생일수 I (GA4_birthday1)C++98
100 / 100
105 ms884 KiB
#include <stdio.h> int main() { int T,N,n3,n5,n8,i,j; scanf("%d",&T); for(i=0;i<T;i++) { n3=0; n5=0; n8=0; scanf("%d",&N); if(N==1||N==2||N==4||N==7) { printf("-1\n"); continue; } while(N>=8) { if(N==9||N==10||N==12||N==15||N==20) break; n8++; N-=8; } while(N>=5) { if(N==6||N==9||N==12) break; n5++; N-=5; } while(N>=3) { n3++; N-=3; } for(j=0;j<n3;j++) printf("3"); for(j=0;j<n5;j++) printf("5"); for(j=0;j<n8;j++) printf("8"); printf("\n"); } 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...