find minimum of left ( i , j ) , right ( i , j ) , top ( i , j ) , bottom ( i , j )
int len = Math . Min ( Math . Min ( top [ i , j ] , bottom [ i , j ] ) , Math . Min ( left [ i , j ] , right [ i , j ] ) ) ;