P11752 [COCI 2024/2025 #5] Zid

Background

译自 [COCI 2024/2025 #5](https://hsin.hr/coci/) T2。$\texttt{1s,0.5G}$。满分为 $70$。

Description

Mr. Malnar wants to put up a picture of himself on the wall. The wall can be represented as a matrix with $n$ rows and $m$ columns. Since he has placed his picture on the wall many times before, some positions still have nails embedded in them. Such positions are marked with the symbol "$\texttt{\#}$", while empty spots are marked with the symbol "$\texttt{.}$". The picture has a rectangular shape with arbitrary dimensions and is placed on the wall in a way that it covers a rectangular area. The picture can be placed on the wall if it covers at most one position that contains a nail. Help Mr. Malnar calculate the number of ways he can place his picture on the wall.

Input Format

N/A

Output Format

N/A

Explanation/Hint

**Clarification of the first example:** Each placement of the picture is valid as long as it covers at most one nail. **Clarification of the second example:** The picture cannot be placed in a way that it covers positions $(3, 1)$ and $(4, 1)$ simultaneously. ### Scoring | Subtask | Points | Constraints | | :--: | :--: | :--: | | $1$ | $17$ | $n,m ≤ 10$ | | $2$ | $21$ | $n,m ≤ 100$ | | $3$ | $32$ | No additional constraints. |