Driver code
public static void main ( String [ ] args ) { int N = 8 , Z = 4 ; int row [ ] = { 4 , 6 } ; int col [ ] = { 3 , 8 } ; int r = row . length ; int d = col . length ; System . out . print ( subgrids ( N , Z , row , col , r , d ) ) ; } }