Problem G: Happy Number

"
Time Limit $1$ 秒/Second(s) Memory Limit $128$ 兆字节/Megabyte(s)
提交总数 $25$ 正确数量 $12$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签 数学
Digits 2, 3 and 6 are happy, while all others are unhappy. An integer is happy if it contains only happy digits in its decimal notation. For example, 2, 3, 263 are happy numbers, while 231 is not.

Now Cuber QQ wants to know the n-th happy positive integer.
The first and only line of input contains a positive integer n ( 1n109).
The first and only line of output contains the n-th happy positive integer.
680
326623