Walking
题号:NC225892
时间限制:C/C++/Rust/Pascal 8秒,其他语言16秒
空间限制:C/C++/Rust/Pascal 1024 M,其他语言2048 M
64bit IO Format: %lld

题目描述

There is an maze with two of the corners of the board having coordinates (1, 1) and (n, m).

Once you are located in the cell (x, y), you can move to the four adjacent cells (x - 1, y), (x + 1, y), (x, y - 1) and (x, y + 1) in one second, and you must keep moving, which means that you cannot stay in one cell. Also, you cannot move outside the maze.

Now you start at (a, b), and you should keep moving for t seconds. You are asked to figure out the number of possible moving trails.

Here a moving trail is the sequence of the moving strategy during your moving. For example, if you start at (1, 1) and at the following 5 seconds you move to (2, 1), (3, 1), (3, 2), (4, 2) and (3, 2) step by step, the moving trail is (1, 0), (1, 0), (0, 1), (1, 0), and (-1, 0).

Since the answer may be too large, you only need output the result modulo .

输入描述:

The only line contains five integers ,  and .

输出描述:

Output a single integer, indicating the answer modulo .
示例1

输入

复制
1 1 1 1 1

输出

复制
0
示例2

输入

复制
1 2 1 2 1

输出

复制
1
示例3

输入

复制
1 2 2 2 1

输出

复制
2