[Solution] Minimum Varied Number Codeforces Solution
C. Minimum Varied Number
time limit per test
1 secondmemory limit per test
256 megabytesinput
standard inputoutput
standard outputFind the minimum number with the given sum of digits such that all digits in it are distinct (i.e. all digits are unique).
For example, if , then the answer is . This is the minimum number in which all digits are different and the sum of the digits is ().
For the given print the required number.
Input
The first line contains an integer () — the number of test cases.
Each test case is specified by a line that contains the only integer ().
Output
Print integers — the answers to the given test cases
No comments:
Post a Comment