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