{"problem":{"name":"Neq Number","description":{"content":"A positive integer $X$ is called a **\"Neq Number\"** if it satisfies the following condition: *   When $X$ is written in decimal notation, no two adjacent characters are the same. For example, $1$, $","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc173_a"},"statements":[{"statement_type":"Markdown","content":"A positive integer $X$ is called a **\"Neq Number\"** if it satisfies the following condition:\n\n*   When $X$ is written in decimal notation, no two adjacent characters are the same.\n\nFor example, $1$, $173$, and $9090$ are Neq Numbers, while $22$ and $6335$ are not.\nYou are given a positive integer $K$. Find the $K$\\-th smallest Neq Number.\nYou have $T$ test cases to solve.\n\n## Constraints\n\n*   $1 \\leq T \\leq 100$\n*   $1 \\leq K \\leq 10^{12}$\n*   All input values are integers.\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$T$\n$\\mathrm{case}_1$\n$\\vdots$\n$\\mathrm{case}_T$\n\nEach case is given in the following format:\n\n$K$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc173_a","tags":[],"sample_group":[["3\n25\n148\n998244353","27\n173\n2506230721\n\nFor the first test case, here are the smallest $25$ Neq Numbers in ascending order:\n\n*   The nine integers from $1$ to $9$\n*   The nine integers from $10$ to $19$, excluding $11$\n*   The seven integers from $20$ to $27$, excluding $22$\n\nThus, the $25$\\-th smallest Neq Number is $27$."]],"created_at":"2026-03-03 11:01:14"}}