Function that returns true if the assignment of directions is possible
static bool isPossible ( int [ , ] range , int N ) { interval [ ] test = new interval [ N ] ; for ( int i = 0 ; i < N ; i ++ ) { test [ i ] = new interval ( ) ; test [ i ] . l = range [ i , 0 ] ; test [ i ] . r = range [ i , 1 ] ; test [ i ] . v = range [ i , 2 ] ; }