#P1950. 长方形
长方形
Description
Xiao Ming had a sudden idea today: he wants to cut out a rectangle from a used sheet of paper.
To simplify the problem, Xiao Ming makes the following rules:
(1) The paper’s length and width are . Xiao Ming views this sheet as consisting of cells, and when cutting, he can only cut along the edges of the cells.
(2) There are some places on this paper that Xiao Ming drew on before; the cut-out rectangle cannot contain any previously drawn places.
(3) There is no restriction on the size of the rectangle.
Xiao Ming looks at this sheet and comes up with many ways to cut it, but how many ways are there exactly? He cannot count them all. Can you help him?
Input Format
The first line contains two positive integers , representing the length and width of the sheet.
Then there are lines, each with characters. Each character is either * or ..
The character * means this cell was drawn on before, and the character . means this cell was not drawn on before.
Output Format
Output a single integer, the number of ways.
6 4
....
.***
.*..
.***
...*
.***
38
Hint
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号