You are given an matrix
. Each of its elements is either
or
.
A cross of size is a subregion of
, centering at one of its elements, containing the center and
elements in each of the four orthogonal directions (i.e., horizontal and vertical directions).
A cross is called "symmetric" if it does not change after being rotated by degrees. Please find the cross with the largest size in
. It is guaranteed that there is exactly one such cross.
Input Specification
The first line contains two integers and
, the number of rows and columns of
. The next
lines each contain
numbers separated by one space, representing
.
- In
of the test cases,
.
- In
of the test cases,
.
Output Specification
The output contains a single line with three integers: the size of the largest symmetric cross in , and the row and column number of its center.
Sample Input 1
5 5
0 0 1 0 0
0 0 0 0 0
1 0 1 0 1
0 0 0 0 0
0 0 1 0 0
Sample Output 1
2 3 3
Sample Input 2
5 5
0 0 1 0 0
0 1 0 0 1
1 0 1 0 0
0 0 1 0 1
0 0 1 0 0
Sample Output 2
1 2 2
Comments
how does my code pass in pypy but MLE in python?