#P3272. [SCOI2011] 地板
[SCOI2011] 地板
Description
lxhgww’s nickname is “Little L” (Xiao L), because he always likes L-shaped things.
Little L’s living room is an rectangle. He wants to cover the entire living room with L-shaped tiles. Some positions contain pillars and cannot be tiled.
Little L wants to know how many different ways there are to tile the living room using L-shaped tiles.
Note that, as shown in the figure below, the two arms of an L-shaped tile can have any positive lengths, but neither arm can have length .

After tiling, every position without a pillar must be covered by tiles, and no position may be covered more than once.
Input Format
The first line contains two integers, and , representing the size of the living room.
Then follow lines, each containing characters. Each character is either _ or *. _ indicates the position is empty and must be tiled; * indicates the position has a pillar and cannot be tiled.
Output Format
Output one line containing an integer: the number of tiling schemes. Since this number can be large, print the remainder when it is divided by .
2 2
*_
__
1
3 3
___
_*_
___
8
Hint
Constraints
| Test point ID | Limits |
|---|---|
| and ( or ) | |
Translated by ChatGPT 5
京公网安备 11011102002149号