Nayra doesn't like stories of people receiving random arrays as birthday presents, but this time she received random arrays as presents for her own birthday! After struggling for a day trying to figure out what to do with the array, she asked Aryan for help. He gave her the following problem.
Given
integers and.
- Let
- .
There are
distinct arrays such that.
Calculate the sum of
over all such arrays. Since the answer can be huge, print it modulo.
Input Format
- First line will contain
- .
Output Format
For each test case, output a single line containing the value of the given sum modulo
.
Constraints
- .
Sample Input 1
6
1 1 1
2 2 1
3 1 2
2 2 3
2 2 2
2 10000000 1
Sample Output 1
1
9
37
13
11
432888326
Explanation
Test case
: There are distinct arrays. The arrays are : and.
- .
Sum of
is.
Test case
: There are distinct arrays. The arrays are : and.
- .
Sum of
is .
ConversionConversion EmoticonEmoticon