#P1817. 棋盘染色
棋盘染色
Description
Given an grid, each cell can be colored black or white. All black cells must be connected, all white cells must be connected, and at least one black cell is on the border while at least one white cell is on the border. How many valid colorings are there?
Input Format
The first line contains two positive integers .
Output Format
Output a single positive integer representing the answer.
1 2
2
2 3
30
Hint
Constraints: For of the testdata: , .
Translated by ChatGPT 5
京公网安备 11011102002149号