Plotting for Good
Some people plot to take over the world. Farmer Ray plots flowers.
Ray has an plot of land he'd like to place flower beds in. He has two kinds of flower beds:
- Long beds, which are
.
- Tiny beds, which are
.
Ray can arrange any number of these beds within his plot so that they don't overlap, completely cover the plot, and don't go outside of it. How many arrangements of beds can he make?
Input
The only line contains two integers
and
, the dimensions of Ray's plot.
Output
Output the number of ways Ray can fill out his flowerbed using any number of and
flower beds.
Clarifications
- Rotations of the same arrangement are considered different to each other.
- An arragement can use all of the same type of bed. There is no limit to the number of beds that Ray has.
Example
Input 1
3 4
Output 1
56
There are 56 possible arrangements of and
flowerbeds on a
plot of land.
Input 2
2 2
Output 2
7
There are 7 possible arrangements of and
flowerbeds on a
plot of land.
Input 3
1 1
Output 3
2
In this case, the plots are or
. In this edge case, we consider the types of plots to be distinct, so there are 2 arrangements.
Comments