传统题 1000ms 256MiB

D - Hanjo

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

D - Hanjo

Score : $400$ points

Problem Statement

We have a rectangular room that is $H$ meters long and $W$ meters wide.
We will cover this room with $A$ indistinguishable $2$ meters $\times$ $1$ meters rectangular tatami mats and $B$ indistinguishable $1$ meter $\times$ $1$ meter square tatami mats. The rectangular mats can be used in either direction: they can be $2$ meters long and $1$ meter wide, or $1$ meter long and $2$ meters wide.
How many ways are there to do this?
Here, it is guaranteed that $2A + B = HW$, and two ways are distinguished if they match only after rotation, reflection, or both.

Constraints

  • All values in input are integers.
  • $1 ≤ H, W$
  • $HW ≤ 16$
  • $0 ≤ A, B$
  • $2A + B = HW$

Input

Input is given from Standard Input in the following format:

HH WW AA BB

Output

Print the answer.


2 2 1 2
4

There are four ways as follows:


3 3 4 1
18

There are six ways as follows, and their rotations.


4 4 8 0
36

2024春季入门组刷题营(六)

未参加
状态
已结束
规则
IOI
题目
8
开始于
2024-4-17 18:00
结束于
2024-4-17 21:00
持续时间
3 小时
主持人
参赛人数
10