Rar the Cat is playing a video game. The objective of it is to move from one corner of a square room to the opposite corner. However, there are pillars which he cannot go through (obviously) and bombs which will cause him to lose some lives. He will have
Input Specification
Line 1 of input will be
Line 2 of input will be the length of the room,
The next .
, P
, or a number representing the number of lives you will lose if you go into it. A P
represents a pillar. The top left character will not be a pillar.
Output Specification
The number of ways (mod
Constraints
Subtask 1 [100%]
Subtask 2 [0%]
Sample test cases.
Sample Input
3
3
.P2
..2
12.
Sample Output
2
Comments
I'm getting an IR status code on the first case when I submit my Python code and I have no idea what could be causing it. The sample input works fine. Is there another sample input that I could use to figure out what I'm doing wrong?
Since the original data were wrong, they were updated.