7042.Maximum Building I

Time Limit: 1s Memory Limit: 512MB

You are given a map of a forest where some squares are empty and some squares have trees.

What is the maximum area of a rectangular building that can be placed in the forest so that no trees must be cut down?

Input Format(From the terminal/stdin)

The first input line contains integers $n$ and $m$ : the size of the forest.

After this, the forest is described. Each square is empty ( . ) or has trees ( * ).

Print the maximum area of a rectangular building.

  • $1 \le n,m \le 1000$

Output Format(To the terminal/stdout)

Sample Input

Copy
4 7
...*.*.
.*.....
.......
......*
 · \n
       \n
       \n
       \n
       \n

Sample Output

Copy
12
  \n
Source: CSES, Additional Problems I, 1147

Submit

请先 登录

© 2025 FAQs