408037: GYM102966 A Atsa's Checkers Board

Memory Limit:256 MB Time Limit:0 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Atsa's Checkers Boardtime limit per test0.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output

Atsa is constantly looking for new ways to have fun during this quarantine, she used to play checkers against her friends but, after winning against each of them, no one wants to play checkers against her anymore. Atsa now considers to play checkers alone, but found a more interesting way to challenge herself.

A checkers board is represented by a rectangular grid with $$$N$$$ rows and $$$M$$$ columns, with a total of $$$N$$$x$$$M$$$ cells. Each cell has a light color, or a dark color, in such way that no adjacent cells have the same color, the figure below shows a checkers board with $$$8$$$ rows and $$$8$$$ columns:

Since Atsa has a lot of checkers boards, she also has a lot of stones to play checkers, she has enough stones to place at least one stone on each cell of any of her checkers boards. Similar to the cells in the board, each stone is either light colored or dark colored. Atsa found that if she places a light colored stone on each light colored cell of the board, and a dark colored stone on each dark colored cell, then all squares of $$$2$$$x$$$2$$$ cells in the board will have two dark colored stones, and two light colored stones, she defined this configuration as a "pairable" stones configurations. Atsa believes this is not the only "pairable" stones configuration in the board and decided to find all of them on each of the boards she has. Are you be able to find how many distinct "pairable" stones configurations can be placed in a checkers board?

Input

The first and only line of input contains two integer numbers separated by a space, representing respectively, the number $$$N$$$ of rows in the board, and the number $$$M$$$ of columns in the board ($$$1 \leq N, M \leq 60$$$).

Output

Output a single line with a single number, representing, the number of distinct "pairable" stones configurations that Atsa can place in the checkers board given in the input.

ExamplesInput
2 2
Output
6
Input
2 3
Output
10

加入题单

算法标签: