Class for each node in the segment tree
class node { public : int l1 , r1 , l0 , r0 ; int min0 , max0 , min1 , max1 ; node ( ) { l1 = r1 = l0 = r0 = -1 ; max1 = max0 = INT_MIN ; min1 = min0 = INT_MAX ; } } seg [ 100001 ] ;