Return number of ones in square submatrix of size k x k starting from ( x , y )
static int cal ( int [ , ] ones , 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 ] ; }