checks whether the point crosses the convex hull or not
static int orientation ( ArrayList < Integer > a , ArrayList < Integer > b , ArrayList < Integer > c ) { int res = ( b . get ( 1 ) - a . get ( 1 ) ) * ( c . get ( 0 ) - b . get ( 0 ) ) - ( c . get ( 1 ) - b . get ( 1 ) ) * ( b . get ( 0 ) - a . get ( 0 ) ) ; if ( res == 0 ) return 0 ; if ( res > 0 ) return 1 ; return - 1 ; }