INNOV101 - Editorial

PROBLEM LINK
Pactice

DIFFICULTY
Easy

PREREQUISITES
Strings, Math.

DEFINITION
To find the smallest number possible whose sum is N and number is divisible by 10^N.

QUICK EXPLANATION
The focus should be on how to find the smallest number possible whose sum is N.
Then after then you can just simply print N zeroes.

EXPLANATION
To find the smallest number possible whose sum is equal to N you just need to decrement the number by 9 and append it to new string while the number is greater then 9. then you can just append the remainder to the string. That will be our smallest number with sum equal to N. and after that you simply print N zeroes.

SOLUTION
Solution can be found here