CF543A Writing Code
Description
Programmers working on a large project have just received a task to write exactly $ m $ lines of code. There are $ n $ programmers working on a project, the $ i $ -th of them makes exactly $ a_{i} $ bugs in every line of code that he writes.
Let's call a sequence of non-negative integers $ v_{1},v_{2},...,v_{n} $ a plan, if $ v_{1}+v_{2}+...+v_{n}=m $ . The programmers follow the plan like that: in the beginning the first programmer writes the first $ v_{1} $ lines of the given task, then the second programmer writes $ v_{2} $ more lines of the given task, and so on. In the end, the last programmer writes the remaining lines of the code. Let's call a plan good, if all the written lines of the task contain at most $ b $ bugs in total.
Your task is to determine how many distinct good plans are there. As the number of plans can be large, print the remainder of this number modulo given positive integer $ mod $ .
Input Format
N/A
Output Format
N/A