Even Digits

AtCoder
IDabc336_c
Time2000ms
Memory256MB
Difficulty
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. ## Constraints * $1 \leq N \leq 10^{12}$ * $N$ is an integer. ## Input The input is given from Standard Input in the following format: $N$ [samples]
Samples
Input #1
8
Output #1
24

The good integers in ascending order are $0, 2, 4, 6, 8, 20, 22, 24, 26, 28, \dots$.  
The eighth smallest is $24$, which should be printed.
Input #2
133
Output #2
2024
Input #3
31415926535
Output #3
2006628868244228
API Response (JSON)
{
  "problem": {
    "name": "Even Digits",
    "description": {
      "content": "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 e",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc336_c"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "A non-negative integer $n$ is called a **good integer** when it satisfies the following condition:\n\n*   All digits in the decimal notation of $n$ are even numbers ($0$, $2$, $4$, $6$, and $8$).\n\nFor e...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments