#P8707. [蓝桥杯 2020 省 AB1] 走方格

[蓝桥杯 2020 省 AB1] 走方格

Problem Description

There are some 2D lattice points on a plane.

The numbering of these points is like a 2D array: from top to bottom are rows 11 to nn, and from left to right are columns 11 to mm. Each point can be represented by its row number and column number.

Now a person stands at row 11, column 11, and wants to walk to row nn, column mm. They can only move right or down.

Note that if both the row number and the column number are even, you are not allowed to enter that cell.

How many different ways are there?

Input Format

One line contains two integers nn and mm.

Output Format

Output one integer, the answer.

3 4
2

Hint

1n,m301\le n,m\le30.

Lanqiao Cup 2020 First Round Provincial Contest, Group A Problem G (Group B Problem H).

Translated by ChatGPT 5