Store pair having map value X - curr_sum
Tuple < int , int > p = Map [ X - curr_sum ] ; if ( p . Item1 != i && p . Item2 != i && p . Item1 != j && p . Item2 != j && temp [ p . Item1 ] == 0 && temp [ p . Item2 ] == 0 && temp [ i ] == 0 && temp [ j ] == 0 ) {