#C7769. Find the Minimal Zero-Even Digit Number
Find the Minimal Zero-Even Digit Number
Find the Minimal Zero-Even Digit Number
You are given a positive integer k. Your task is to construct an integer m that satisfies the following conditions:
- The integer m has exactly k digits.
- Every digit of m is even. In other words, each digit is chosen from the set \(\{0, 2, 4, 6, 8\}\).
- The number of zero digits in m is minimized.
Note that leading zeros are not allowed. Therefore, it is optimal to use non-zero even digits whenever possible. For example, when k = 1, a valid answer is 2
(since 2 is the smallest non-zero even digit). When k > 1, one simple construction is to set the first digit to 2 and all remaining k - 1 digits to 4, resulting in the number 2
followed by exactly k - 1 occurrences of 4
(i.e., 2
+ 4
k-1).
The task is to output the constructed integer m for each test case.
inputFormat
The first line of input contains a single integer T (1 ≤ T ≤ 104), which denotes the number of test cases. Each of the following T lines contains a single integer k (1 ≤ k ≤ 105), representing the number of digits.
outputFormat
For each test case, output the constructed integer m on a new line. The integer should have exactly k digits and use no zero digit if possible.
## sample3
1
2
4
2
24
2444
</p>