AtCoder Regular Contest 153
A
AABCDDEFE
AtCoder
⌀ 0
原题
←B →
翻译中…

Problem Statement

翻译中…

A positive integer $x$ is said to be a beautiful integer if and only if $x$ is a $9$-digit integer whose decimal notation $S_1\ldots S_9$ ($S_i$ is the $i$-th character) satisfies all of the following conditions:

翻译中…
  • $S_1$ is not 0,
  • $S_1 = S_2$,
  • $S_5 = S_6$, and
  • $S_7 = S_9$.
翻译中…

For instance, $998244353$ and $333333333$ are beautiful integers, while $111112222$ is not, since $S_5 \neq S_6$.

翻译中…

You are given a positive integer $N$. Print the $N$-th smallest beautiful integer.

翻译中…

Constraints

翻译中…
  • $N$ is a positive integer.
  • There are at least $N$ beautiful integers.
翻译中…

Input

翻译中…

The input is given from Standard Input in the following format:

翻译中…

N

翻译中…

Output

翻译中…

Print the $N$-th smallest beautiful integer.

翻译中…

样例

Input #1
3
Output #1
110000020
The beautiful integers in ascending order are $110000000, 110000010, 110000020, \ldots$.
Input #2
882436
Output #2
998244353
Input #3
2023
Output #3
110200222
题目信息
题号
arc153_a
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。