A chessboard is a NxN binary matrix with rows and columns numbered from 1 to N. Each position of the matrix is black (1) if the sum of the row number and the column number is even; otherwise it is white (0). The following pictures show how a chessboard looks like for N=1, 2 and 3.
Given a NxN binary matrix, find the size of the largest chessboard completely located inside the matrix, as well as the number of chessboards having the largest size (these chessboards may overlap).