Submission #2348

# Submission time Handle Problem Language Result Execution time Memory
2348 2013-07-21T03:47:55 Z ldj5098 생일수 I (GA4_birthday1) C++
0 / 100
229 ms 1376 KB
#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 time Memory Grader output
1 Incorrect 0 ms 1376 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1376 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 1376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 229 ms 1376 KB Output isn't correct
2 Halted 0 ms 0 KB -