#000090

Digits

For a given integer N find how many numbers that are less or equal than N have the sum of their digitis equal to some number K.


InputFrom the first line of the standard input read two integers N and K,
N<=1000 and K<=100 separated with blank space.

OutputTo the standard output, output one integer representing the number of integers not larger than N that have the sum of the digits equal to K.

Input:
15 3
Outpu:
2

Input:
100 8
Output:
9

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.