#P1714C. Minimum Varied Number
Minimum Varied Number
Description
Find the minimum number with the given sum of digits $s$ such that all digits in it are distinct (i.e. all digits are unique).
For example, if $s=20$, then the answer is $389$. This is the minimum number in which all digits are different and the sum of the digits is $20$ ($3+8+9=20$).
For the given $s$ print the required number.
The first line contains an integer $t$ ($1 \le t \le 45$) — the number of test cases.
Each test case is specified by a line that contains the only integer $s$ ($1 \le s \le 45$).
Print $t$ integers — the answers to the given test cases.
Input
The first line contains an integer $t$ ($1 \le t \le 45$) — the number of test cases.
Each test case is specified by a line that contains the only integer $s$ ($1 \le s \le 45$).
Output
Print $t$ integers — the answers to the given test cases.
Samples
<div class="test-example-line test-example-line-even test-example-line-0">4</div><div class="test-example-line test-example-line-odd test-example-line-1">20</div><div class="test-example-line test-example-line-even test-example-line-2">8</div><div class="test-example-line test-example-line-odd test-example-line-3">45</div><div class="test-example-line test-example-line-even test-example-line-4">10</div><div class="test-example-line test-example-line-even test-example-line-4"></div>
389
8
123456789
19