#AT1760. D - Hanjo

D - Hanjo

D - 韩佐

评分: 400分

问题描述

我们有一个长为 H 米,宽为 W 米的矩形房间。 我们将用不可区分的2米乘1米的长方形塌塌米和1米乘1米的方形塌塌米来覆盖这个房间。 长方形的塌塌米可以以任何方向使用:它们可以是2米长,1米宽,或者是1米长,2米宽。 有多少种方法可以做到这一点? 这里,可以保证 2A+B=HW2A + B = HW,并且只有在旋转,翻转或两者都匹配的情况下才会区分两种方式。

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