L

Measharans have a popular board game about placing L-shaped pieces on a
rectangular board. The board consists of normal squares and special
squares. Each piece has the same shape and covers three squares, like on
the picture. Pieces can be put only on normal squares.

[image]

We would like to fill the whole board with our pieces. We would also
like to know the number of possible ways of doing this.

Input

The first line of input contains two numbers X and Y, 2 ≤ X, Y ≤ 16.
These two numbers denote dimensions of the board.

Each of the following Y lines contains X characters, . or #. Dots
represent normal squares, and # signs represent special squares.

Output

Output the number of different partitions into L-shaped pieces. If it is
larger than 10¹⁸, output 10¹⁸ instead.

Problem information

Author: Eryk Kopczynski

Generation: 2026-01-25T14:25:39.422Z

© Jutge.org, 2006–2026.
https://jutge.org
