Lucky Number-2
Submissions: 305   Accuracy:

25.24%

  Difficulty: Basic   Marks: 1

In technical fest there were too many volunteers for technical head of the department thought to take a quick test, by which the lucky volunteers will be selected for the technical fest. So they have to solve a question for it.
Question is to find the Lucky number, Lucky number is a largest number made up of only digits 2,3 and 5 such that the count for each digit is divisible by the number obtained by multiplication of remaining two digits. You are provided with the number N and you have to output the lucky number of N digits. If no lucky number exists for the given N output -1.
So help volunteers to pass the test.

Input:
First line of the input contains an integer T denoting number of test cases. The description of T test cases follows. The only line of each test case contains the integer N denoting the length of Handsome Number.

Output:
For each test case output the Handsome number or -1 if no Handsome Number exist.

Constraints:
1 <= T <= 100
1 <= N <= 100

Example:
Input:

3
4
6
16
Output:
-1
555555
5555553333333333

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Saksham Raj Seth
Author: saksham seth


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.