Given two non-negative integers A, B. Find number of pairs of integers (a,b) such that:
a+b=A and a^{3}+b^{3}=B

Input:
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.

Output:
For each of the test case print the answer in separate line.