Time Limit: 1s
Memory Limit: 512MB
Given a boolean matrix, which means every element of it is either 0 or 1. If each row and each column of it has an even sum, we call it a magic matrix.
For example:
1 0 1 0
0 0 0 0
1 1 1 1
0 1 0 1
is a magic matrix.
If one magic is not a matrix, we want to know whether we can change only one bit to transform it into a magic matrix, or it should be treated as corrupt.
The input file will contain more than one test cases.
The first line of each test case contains one integer n(n<100), which represents the size of the matrix.
The following n lines represents a boolean matrix.
For each input, print one line.
Print "OK" if the given matrix is a magic matrix.
Print "Chang bit (i,j)" if change bit (i, j) can make it a magic matrix.
Print "Corrupt" if the given matrix is not OK and cannot be transform into a magic matrix with one bit changed.
4 1 0 1 0 0 0 0 0 1 1 1 1 0 1 0 1 4 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 1 4 1 0 1 0 0 0 1 0 1 1 1 1 0 1 0 1 0
OK Corrupt Change bit (2,3)