Codeforces Global Round 7
A
Bad Ugly Numbers
Codeforces
1000
原题
←B →
翻译中…

You are given a integer $n$ ($n \gt 0$). Find any integer $s$ which satisfies these conditions, or report that there are no such numbers:

翻译中…

In the decimal representation of $s$:

翻译中…
  • $s \gt 0$,
  • $s$ consists of $n$ digits,
  • no digit in $s$ equals $0$,
  • $s$ is not divisible by any of it's digits.
翻译中…

Input

翻译中…

The input consists of multiple test cases. The first line of the input contains a single integer $t$ ($1 \leq t \leq 400$), the number of test cases. The next $t$ lines each describe a test case.

翻译中…

Each test case contains one positive integer $n$ ($1 \leq n \leq 10^5$).

翻译中…

It is guaranteed that the sum of $n$ for all test cases does not exceed $10^5$.

翻译中…

Output

翻译中…

For each test case, print an integer $s$ which satisfies the conditions described above, or "-1" (without quotes), if no such number exists. If there are multiple possible solutions for $s$, print any solution.

翻译中…

Note

翻译中…

In the first test case, there are no possible solutions for $s$ consisting of one digit, because any such solution is divisible by itself.

翻译中…

For the second test case, the possible solutions are: $23$, $27$, $29$, $34$, $37$, $38$, $43$, $46$, $47$, $49$, $53$, $54$, $56$, $57$, $58$, $59$, $67$, $68$, $69$, $73$, $74$, $76$, $78$, $79$, $83$, $86$, $87$, $89$, $94$, $97$, and $98$.

翻译中…

For the third test case, one possible solution is $239$ because $239$ is not divisible by $2$, $3$ or $9$ and has three digits (none of which equals zero).

翻译中…

样例

Input #1
4
1
2
3
4
Output #1
-1
57
239
6789
InputCopy OutputCopy
题目信息
题号
1326A
时间限制
1 s
内存限制
256 MB
标签
构造
数论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。