#P4537. [CQOI2007] 矩形

[CQOI2007] 矩形

Description

Given an a×ba\times b rectangle formed by a×ba\times b 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 3×23\times 2 rectangle has 1515 ways.

Input Format

The input contains a single line with two integers a,ba,b (1a61 \le a \le 6, 2b72 \le b \le 7).

Output Format

Output a single line with the total number of ways.

3 2
15

Hint

Translated by ChatGPT 5