#P4147. 玉蟾宫
玉蟾宫
Description
This piece of land is divided into cells. Each cell contains R or F. R means the cell is granted to rainbow, and F means it is granted to freda.
Now freda wants to act cute here... She wants to find a rectangular piece of land that is all F, with the largest possible area.
But rainbow and freda are very weak at OI, and Blue Rabbit also wants to watch freda act cute (she obviously cannot program), so they decide that if the largest area you find is , each of them will give you taels of silver.
Input Format
The first line contains two integers and , meaning the rectangular land has rows and columns.
The next lines each contain characters separated by spaces, each being F or R, describing the land.
Output Format
Output a single integer, the amount of silver you can get, i.e., the value of .
5 6
R F F F F F
F F F F F F
R R R F F F
F F F F F F
F F F F F F
45
Hint
Constraints:
- For of the testdata, .
- For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号