Given the root node of a binary search tree and a number k, find out if two nodes exist in the tree which add upto k.
The first line contains an integer T denoting the number of test cases.
For each test case, the input has 2 lines:
For each test case, the output contains 1 or 0 based on whether the required pair exists or not.
4
9
2 1 3 -1 -1 -1 5 4 7
4
7
6 3 21 -1 -1 -1 89
1
12
8 3 9 -1 4 -1 10 -1 -1 -1 12 11
7
4
28 14 -1 11
2
1
0
1
0
1 <= T <= 10
1 <= n <= 105
1 <= node value <= 109