#P7365. [CTSC2002] 颁奖典礼
[CTSC2002] 颁奖典礼
Description
YONG-IN Hall is a rectangular grid area. Each sponsor's exhibition booth occupies several unit cells. The -shaped awards podium will be built upright, and its sides are parallel to the edges of YONG-IN Hall. An -shaped podium is formed by connecting three rectangles, where the rectangles at the top and bottom must extend beyond the middle rectangle on both left and right sides; otherwise, it will be mistaken for letters such as . For example:

These are two valid -shaped podiums, while the following three cases are all invalid:

You are asked to write a program to find the -shaped podium with the maximum area such that it does not cover any exhibition booth.
Input Format
The first line contains two positive integers , representing the number of rows and columns of the rectangular grid area of YONG-IN Hall.
In the next lines, each line contains digits . Each digit describes a unit cell: means there is an exhibition booth in this cell, and means there is no exhibition booth in this cell.
Output Format
Output only one positive integer, the area of the largest -shaped podium. If there is no valid -shaped podium, output .
6 8
1 1 1 1 1 0 0 1
1 0 0 0 0 1 1 1
1 0 0 0 0 0 1 1
1 0 1 0 1 0 1 0
1 0 0 0 0 0 0 1
1 1 0 0 0 1 0 1
15
Hint
For of the data, , .
Sample explanation:

The maximum selectable -shaped podium area is .
Translated by ChatGPT 5
京公网安备 11011102002149号