#P11437. Interesting Numbers

    ID: 13516 Type: Default 1000ms 256MiB

Interesting Numbers

Interesting Numbers

Define an integer as an Interesting Number if and only if its digits in decimal representation are in non-decreasing order when read from left to right. In other words, if a number is written as \(d_1d_2\cdots d_k\), it is interesting if and only if \(d_1 \le d_2 \le \cdots \le d_k\). For example, \(123\) and \(111\) are interesting numbers, while \(10\), \(120\), and \(213\) are not.

Given a positive integer \(n\), output all interesting numbers in the interval [10, n]. Each interesting number should be printed on a new line.

inputFormat

The input consists of a single positive integer \(n\).

outputFormat

Output every interesting number in the range [10, n] (inclusive), each on a separate line. If there is no interesting number in the range, output nothing.

sample

50
11

12 13 14 15 16 17 18 19 22 23 24 25 26 27 28 29 33 34 35 36 37 38 39 44 45 46 47 48 49

</p>