Bobby had a crazy day at school today. On the way back home, Bobby is accompanied by his oldest sister. Since she is a mathematics major in university, she poses a math question to Bobby about the sidewalk they are walking on. The sidewalk consists of an
Help Bobby find the number of ways to tile an
Constraints
Note: You will not be required to pass the sample cases to proceed to the subtasks.
Subtask 1 [10%]
Subtask 2 [20%]
Subtask 3 [40%]
Subtask 4 [30%]
No additional constraints.
Input Specification
The first and only line contains two space-separated integers,
Output Specification
Output will consist of a single integer: the number of possible sidewalks satisfying the given conditions, modulo
Sample Input 1
1 3
Sample Output 1
17
Explanation of Sample 1
The possible arrangements are: BBB
, BBY
, BYB
, BYR
, BYY
, RRR
, RRY
, RYB
, RYR
, RYY
, YBB
, YBY
, YRR
, YRY
, YYB
, YYR
, YYY
.
Sample Input 2
2 4
Sample Output 2
1681
Comments