Traverse the array
for ( int i = 1 ; i < N ; i ++ ) { int b = arr [ i - 1 ] . second ; int d = arr [ i ] . second ; if ( b > d ) { cout << " ( " << arr [ i - 1 ] . first << " ▁ " << b << " ) , ▁ ( " << arr [ i ] . first << " ▁ " << d << " ) " ; return ; } }