L X22835


Statement
 

pdf   zip

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 XX and YY, 2X,Y162 \leq X,Y \leq 16. These two numbers denote dimensions of the board.

Each of the following YY lines contains XX 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 101810^{18}, output 101810^{18} instead.

Public test cases
  • Input

    4 5
    ....
    ..#.
    ....
    ....
    ...#
    

    Output

    4
    
  • Information
    Author
    Eryk Kopczynski
    Language
    English
    Official solutions
    Unknown.
    User solutions
    C++