L X22835


Statement
 

pdf   zip

html

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.

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 1018, output 1018 instead.

Public test cases
  • Input

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

    Output

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