#H2026E. Enlighten the Grid
Enlighten the Grid
Description
Natural and Larutan live in the beautiful River City, through which the Yangtze River flows. To decorate the riverbank, Larutan installed an grid of lights. Initially, all the lights are off.
Natural designed a controller for these lights. In one operation, he chooses a cell and toggles the light in that cell, as well as the lights in the cells directly above, below, to the left, and to the right, provided those cells are within the grid. Each cell may be chosen at most once.
The order of the operations does not affect the final state. Two operation schemes are considered different if they choose different sets of cells. Natural wants to know how many schemes turn on every light in the grid. Output the answer modulo .
Input Format
The input contains three integers , , and , where and are the number of rows and columns in the grid, respectively.
Output Format
Output one integer: the number of valid operation schemes modulo .
Samples
Input #1
2 1 998244353
Output #1
2
Input #2
2 2 998244353
Output #2
1
Input #3
341 741327521 998244353
Output #3
360709869
Sample Explanation
In the first sample, choosing either one of the two cells toggles both lights, so there are two valid schemes.
In the second sample, the only valid scheme is to choose all four cells.
Constraints
For all test cases:
- ;
- ;
- .
相关
在下列比赛中: