Given two non-negative integers A, B. Find number of pairs of integers (a,b) such that:
a+b=A and a3+b3=B
The first line of the test case contains an integer T denoting number of test cases. Each line of the test case contains two space separated integer A and B.
For each of the test case print the answer in separate line.
1 <= T <= 2.3*103
0 <= A,B <= 106
Only (1,2) and (2,1) are such pairs.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.