Company: DevRev_24aug
Difficulty: medium
Numbers and cards Problem Description A deck contains cards of 10 kinds: every card shows one digit from 0 to 9 , and there are exactly K cards showing each digit, so the deck holds 10 * K cards in total. Cards that show the same digit are identical. You take exactly N cards out of the deck. The result is a set of N cards . Two sets are the same when they contain the same number of cards of every digit; the order in which the cards were taken does not matter. In other words, a set is fully described by ten counts, one per digit, where every count is between 0 and K and the ten counts add up to N . Count the number of different sets of N cards. The count can be huge, so return it modulo 1000000007 (that is, 10^9 + 7 ). Complete the function solve with the following parameters: N : an integer, the number of cards to select K : an integer, the number of cards of each digit It returns an integer: the number of different sets of N cards, modulo 1000000007 . Input Format The first line conta