Codeforces Round 460 (Div. 2)
B
Perfect Number
Codeforces
1100
原题
← AC →
翻译中…

We consider a positive integer perfect, if and only if the sum of its digits is exactly $10$. Given a positive integer $k$, your task is to find the $k$-th smallest perfect positive integer.

翻译中…

Input

翻译中…

A single line with a positive integer $k$ ($1 \leq k \leq 10\,000$).

翻译中…

Output

翻译中…

A single number, denoting the $k$-th smallest perfect integer.

翻译中…

Note

翻译中…

The first perfect integer is $19$ and the second one is $28$.

翻译中…

样例

Input #1
1
Output #1
19
InputCopy OutputCopy
Input #2
2
Output #2
28
InputCopy OutputCopy
题目信息
题号
919B
时间限制
2 s
内存限制
256 MB
标签
二分
暴力
动态规划
模拟
数论

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