Two arrays
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given two numbers and . Find the number of pairs of arrays such that:
both arrays have a length of ;
each element of both arrays is an integer from to inclusive;
for every index from to ;
array is sorted in non-decreasing order;
array is sorted in non-increasing order.
Since the result may be too large, compute it modulo .
Input
Two positive integers and .
Output
Print a single number — the number of arrays and that satisfy the conditions described above. Print the result modulo .
Examples
Input #1
Answer #1
Input #2
Answer #2
Submissions 25
Acceptance rate 12%