CF1714C.Minimum Varied Number

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Find the minimum number with the given sum of digits ss such that all digits in it are distinct (i.e. all digits are unique).

For example, if s=20s=20 , then the answer is 389389 . This is the minimum number in which all digits are different and the sum of the digits is 2020 ( 3+8+9=203+8+9=20 ).

For the given ss print the required number.

输入格式

The first line contains an integer tt ( 1t451 \le t \le 45 ) — the number of test cases.

Each test case is specified by a line that contains the only integer ss ( 1s451 \le s \le 45 ).

输出格式

Print tt integers — the answers to the given test cases.

输入输出样例

  • 输入#1

    4
    20
    8
    45
    10

    输出#1

    389
    8
    123456789
    19
首页