P28200 [洛谷] Chessboard Coloring
提高+
题目描述

Problem Description

Given a grid of size $N \times M$, each cell can be colored either black or white. The requirement is that all black cells are connected, all white cells are connected, and there is at least one black cell touching the edge, and at least one white cell touching the edge. How many ways are there to color the grid?

Input Format

The first line contains two positive integers $N$ and $M$.

Output Format

A single positive integer representing the answer.

Sample Input and Output

Sample Input #1

1 2

Sample Output #1

2

Sample Input #2

2 3

Sample Output #2

30

Notes

For $100\%$ of the data: $1 \le N \le 7$, $1 \le M \le 8$.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 2
样例输出
2