Perfect Number

发布时间: 2018年2月1日 16:47   最后更新: 2018年2月1日 18:23   时间限制: 1000ms   内存限制: 128M

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.

The input contains multiple test cases, for each test case:
A single line with a positive integer $k$ ($1 ≤ k ≤ 17809915$).

For each test case: output a single number, denoting the $k$-th smallest perfect integer.

复制
1
2
19
28

dp

Codeforces Round #460 (Div. 2) (加强)