시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB0000.000%

문제

Lenka likes to bake cakes since her childhood, when she has learned to bake from her mom. She soon became a cake expert able to bake chocolate cakes, apple pies, muffins, cookies, cheese cakes, tortes and many other cakes.

Recently, she has started her studies of math at Comenius University in Bratislava. In the first year she is taking combinatorics class. Today she is studying for the final exam. Since the brain needs a lot of sugar to study math, she has baked, just for herself, her favorite, very delicious, strawberry cake.

The cake, still hot, is lying on an N×M inch sheet pan. Hungrily waiting for the cake to cool off Lenka came up with an interesting combinatorial question: How many different possibilities to cut the cake are there so that every connected piece consists of some number of 1×1 inch unit squares?

The cake can be viewed as a grid consisting of N×M unit squares. We are allowed to cut the cake along the grid lines. As a result the cake splits into several connected pieces. (Two unit squares remain connected if they share a side which was not cut.) How many different ways are there to cut the cake? We consider two cuttings of the cake to be the same if the resulting connected pieces of both cuttings have the same shape and are at the same positions within the cake. In other words, we are only counting those cuttings where no cut leads between two unit squares that are in the same connected piece.

The following picture ilustrates all the 12 different possible ways how to cut a 2×2 inch cake:

Note that cutting, for example, as on following picture

is the same as not cutting at all.

입력

The first line of the input file contains two positive integers N and M – dimensions of the cake.

출력

Output a single positive integer – the number of different possibilities how to cut the cake.

제한

  • NM

서브태스크

번호배점제한
11

N = 1, 1 ≤ M ≤ 63

22

N = 2, 2 ≤ M ≤ 24

33

N = 3, 3 ≤ M ≤ 15

44

N = 4, 4 ≤ M ≤ 11

55

N = 5, 5 ≤ M ≤ 8

예제 입력 1

1 2

예제 출력 1

2

예제 입력 2

2 2

예제 출력 2

12

예제 입력 3

4 6

예제 출력 3

6273056950

채점 및 기타 정보

  • 예제는 채점하지 않는다.