#1529. 宝库通道 (Treasure Passage)
宝库通道 (Treasure Passage)
Description
The journey of treasure hunting is underway. With your help, Coco successfully ignited the lamp array, avoided many deadly traps, and finally arrived at the main hall of the palace. The floor of the hall is composed of square stones of the same size. These stones are colored either black or white to form a rectangle of dimensions . Below one of the stones is a pathway. The passage to the treasure house. It is impossible for Xiao Keke to try one stone at a time, because some stones are equipped with mechanisms, which will be triggered when touched, and the entire palace will collapse. According to the treasure map, the passage is in a certain area. This area is a small rectangle with a non-zero area, composed of several stones, and its four sides are parallel to the sides of the hall floor. If the entire hall floor is divided into rectangles arbitrarily, then among all the rectangles, the difference between the number of black stones minus the number of white stones in this area is the largest.
Little Coco hopes to divide the work with you: Let him choose the area, and you can calculate the difference between the number of black and white stones, denoted by . In this way, the area where the passage is located can be quickly and accurately confirmed. The treasure map says that none of the stones in this area have any trap mechanism. As long as the area is determined, the passage will be found. The treasure is here, come on! (Consider 1 is used for black stones and 0 is used for white stones)
Input Format
The first line of the input file contains two integers . The following lines have characters in each line, and each character is either 0
or 1
.
Output Format
The output file contains only one number, which represents the largest value (see the description) in all possible areas.
3 4
1011
1111
1111
10
Constraints
For data, .