Техника двух указателей
Given an array A and a value of x. Find if there is a triplet (
Ak) in array whose sum is equal to x. All indices i, j, k must be different.
The first line contains the size of array n (n ≤
104) and value of x (|x| ≤
109). Second line cintains n integers, each no more than
109 by absolute value.
If such triplet is present in array, then print these three numbers in any order. If multiple triplets exist, print any. If such a triplet is not present in array, print -1.
8 19 20 3 5 1 15 7 17 12
1 3 15