#B3949. Counting Nebula Numbers

    ID: 11606 Type: Default 1000ms 256MiB

Counting Nebula Numbers

Counting Nebula Numbers

A nebula number is defined as a positive integer which has at most \( n \) digits and the sum of its digits is at most \( k \). Given two positive integers \( n \) and \( k \), your task is to count the number of nebula numbers.

Problem Statement

For a given \( n \) and \( k \), count all positive integers that have at most \( n \) digits and whose digits sum to no more than \( k \). Note that numbers with fewer than \( n \) digits are allowed.

Important Note

Leading zeros are not allowed (i.e. numbers cannot start with 0) and the number 0 is not considered a positive integer.

inputFormat

The input consists of a single line containing two space-separated integers \( n \) and \( k \), where \( 1 \leq n, k \leq 100 \) (the constraints are not strictly specified so assume reasonable limits).

outputFormat

Output a single integer representing the count of nebula numbers.

sample

1 5
5