Return number of ones in square submatrix of size k x k starting from ( x , y )
int cal ( int ones [ R + 1 ] [ C + 1 ] , int x , int y , int k ) { return ones [ x + k - 1 ] [ y + k - 1 ] - ones [ x - 1 ] [ y + k - 1 ] - ones [ x + k - 1 ] [ y - 1 ] + ones [ x - 1 ] [ y - 1 ] ; }