97 atcoder#ABC145D. [ABC145D] Knight
[ABC145D] Knight
Score : points
Problem Statement
There is a knight - the chess piece - at the origin of a two-dimensional grid.
When the knight is at the square , it can be moved to either or .
In how many ways can the knight reach the square ?
Find the number of ways modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of ways for the knight to reach from , modulo .
3 3
2
There are two ways: and .
2 2
0
The knight cannot reach .
999999 999999
151840682
Print the number of ways modulo .