n-digit numbers
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Find all n-digit numbers with sum of digits equals to s.
Input
Two integers n (1 ≤ n ≤ 6) and s (0 ≤ s ≤ 54).
Output
Print all n-digit numbers in increasing order which sum of digits equals to s. Print each number in a separate line.
Examples
Input #1
Answer #1
Input #2
Answer #2
Input #3
Answer #3
Submissions 3K
Acceptance rate 54%