9120: ABC336 —— C - Even Digits
[Creator : ]
Description
A non-negative integer $n$ is called a good integer when it satisfies the following condition:
- All digits in the decimal notation of $n$ are even numbers ($0$, $2$, $4$, $6$, and $8$).
For example, $0$, $68$, and $2024$ are good integers.
You are given an integer $N$. Find the $N$-th smallest good integer.
- All digits in the decimal notation of $n$ are even numbers ($0$, $2$, $4$, $6$, and $8$).
For example, $0$, $68$, and $2024$ are good integers.
You are given an integer $N$. Find the $N$-th smallest good integer.
Input
The input is given from Standard Input in the following format:
```
$N$
```
```
$N$
```
Output
Print the $N$-th smallest good integer.
Constraints
- $1 \leq N \leq 10^{12}$
- $N$ is an integer.
- $N$ is an integer.
Sample 1 Input
8
Sample 1 Output
24
The good integers in ascending order are 0,2,4,6,8,20,22,24,26,28,…
The eighth smallest is 24, which should be printed.
The eighth smallest is 24, which should be printed.
Sample 2 Input
133
Sample 2 Output
2024
Sample 3 Input
31415926535
Sample 3 Output
2006628868244228
HINT
相同题目:ABC336。