时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld
题目描述
In ICPCCamp, candies are in different sizes.
There are f(i) (defined below) distinct types of candies of i grams where
Bobo would like to buy some candies whose sum of weight is m grams and align them in a row.
Find the number of different ways modulo
)
.
Note that two ways are different if they differs in the types or in the order of alignment.
输入描述:
The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains two integers n and m.
The second line contains n integers
.
The third line contains n integers
.
输出描述:
For each test case, print an integer which denotes the result.
示例1
输入
复制
2 3
1 2
2 1
2 2
0 0
1 1
2 1000000000
1 2
3 4
备注:
* 
* 
* 
* The number of test cases does not exceed 10.