Driver code
public static void Main ( String [ ] args ) { pair [ ] a = { new pair ( 1 , 3 ) , new pair ( 4 , 7 ) , new pair ( 8 , 11 ) } ; int n = a . Length ; int k = 6 ; int index = findNumber ( a , n , k ) ; if ( index != - 1 ) Console . WriteLine ( index ) ; else Console . WriteLine ( - 1 ) ; } }