#P4858. [PA 2013] Karty
[PA 2013] Karty
Problem Description
Given an rectangle, each cell is either _ or X. Choose the largest possible rectangle such that multiple rectangles (overlapping is allowed) can cover all X cells, and do not cover any _ cells.
Input Format
The first line contains , as described above.
The next lines each contain a string of length describing the matrix.
Output Format
Output one line with two integers , separated by a space.
If there are multiple choices with the maximum area, output the one with the smallest .
4 5
_XXX_
XXXX_
XXXXX
_XXXX
2 3
Hint
Constraints: for of the testdata, .
Translated by ChatGPT 5