GUPTA MECHANICAL

IN THIS WEBSITE I CAN TELL ALL ABOUT TECH. TIPS AND TRICKS APP REVIEWS AND UNBOXINGS ALSO TECH. NEWS .............

Monday 1 August 2022

[Solution] Minimum Varied Number Codeforces Solution



C. Minimum Varied Number
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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.

Input

Solution Click Below:-  👉CLICK HERE👈

👇👇👇👇👇

 occupied

The first line contains an integer t (1t45) — the number of test cases.

Each test case is specified by a line that contains the only integer s (1s45).

Output

Print t integers — the answers to the given test cases

No comments:

Post a Comment