Upload code_segments/segment_394.txt with huggingface_hub
Browse files
code_segments/segment_394.txt
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
There are 3 heroes and 3 villains, so 6 people in total.
|
| 2 |
+
|
| 3 |
+
Given a positive integer $n$. Find the smallest integer whose decimal representation has length $n$ and consists only of $3$s and $6$s such that it is divisible by both $33$ and $66$. If no such integer exists, print $-1$.
|
| 4 |
+
|
| 5 |
+
The first line contains a single integer $t$ ($1\le t\le 500$) — the number of test cases.
|
| 6 |
+
|
| 7 |
+
The only line of each test case contains a single integer $n$ ($1\le n\le 500$) — the length of the decimal representation.
|
| 8 |
+
|
| 9 |
+
For each test case, output the smallest required integer if such an integer exists and $-1$ otherwise.
|
| 10 |
+
|
| 11 |
+
For $n=1$, no such integer exists as neither $3$ nor $6$ is divisible by $33$.
|
| 12 |
+
|
| 13 |
+
For $n=2$, $66$ consists only of $6$s and it is divisible by both $33$ and $66$.
|
| 14 |
+
|
| 15 |
+
For $n=3$, no such integer exists. Only $363$ is divisible by $33$, but it is not divisible by $66$.
|
| 16 |
+
|
| 17 |
+
For $n=4$, $3366$ and $6666$ are divisible by both $33$ and $66$, and $3366$ is the smallest.
|