AtCoder Beginner Contest 196
翻译中…
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:
翻译中…
H W A B
翻译中…
Output
翻译中…
Print the answer.
翻译中…
样例
Input #1
2 2 1 2
Output #1
4
There are four ways as follows:

Input #2
3 3 4 1
Output #2
18
There are six ways as follows, and their rotations.

Input #3
4 4 8 0
Output #3
36
题目信息
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。