Sum of digits
Easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
Determine the smallest and largest N
-digit natural numbers whose digits sum up to M
.
The input consists of two numbers, N and M (1≤N≤100, 1≤M≤9*N).The output should display two N
-digit numbers in ascending order.
Examples
Input #1
Answer #1
Submissions 2K
Acceptance rate 29%