Function to calculate no of zeros
public static bool check ( pair one , pair two ) { int top = Math . Min ( one . x , one . y ) ; int left = Math . Min ( two . x , two . y ) ; if ( top > left ) return true ; else return false ; }