{"problem":{"name":"Flip and Rectangles","description":{"content":"We have a board with an $H \\times W$ grid. Each square in the grid is painted in black or white. The square at the $i$\\-th row from the top and $j$\\-th column from the left is black if the $j$\\-th cha","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc081_d"},"statements":[{"statement_type":"Markdown","content":"We have a board with an $H \\times W$ grid. Each square in the grid is painted in black or white. The square at the $i$\\-th row from the top and $j$\\-th column from the left is black if the $j$\\-th character in $S_i$ is `#`, and white if that character is `.`.\nSnuke can perform the following operation on the grid any number of times:\n\n*   Select a row or column in the grid, and invert the color of all the squares in that row or column (that is, black squares become white and vice versa).\n\nThen, Snuke draws a rectangle along grid lines. Here, all the squares contained in the rectangle must be painted in black.\nFind the maximum possible area of Snuke's rectangle when the operation is performed optimally.\n\n## Constraints\n\n*   $2 \\leq H \\leq 2000$\n*   $2 \\leq W \\leq 2000$\n*   $|S_i| = W$\n*   $S_i$ consists of `#` and `.`.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$H$ $W$\n$S_1$\n$S_2$\n$:$\n$S_H$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc081_d","tags":[],"sample_group":[["3 3\n..#\n##.\n.#.","6\n\nIf the first row from the top and the third column from the left are inverted, a $2 \\times 3$ rectangle can be drawn, as shown below:\n![image](https://atcoder.jp/img/arc081/2995c3921ed4dffc8ee528b63b9c6118.png)"],["4 4\n....\n....\n....\n....","16"],["10 8\n##...#.#\n##...#.#\n..###.#.\n#.##.#.#\n.#..#.#.\n..##.#.#\n##.#.#..\n...#.#..\n###.#.##\n###..###","27"]],"created_at":"2026-03-03 11:01:13"}}