#P4537. [CQOI2007] 矩形
[CQOI2007] 矩形
Description
Given an rectangle formed by unit squares. You need to split it along the grid lines into two non-empty parts such that in each part all cells are connected, and at least one cell lies on the boundary of the original rectangle. “Connected” means any two cells can be connected by a path that moves only horizontally or vertically. Find the total number of such ways. For example, a rectangle has ways.

Input Format
The input contains a single line with two integers (, ).
Output Format
Output a single line with the total number of ways.
3 2
15
Hint
Translated by ChatGPT 5
京公网安备 11011102002149号