Please enter your email address or userHandle.
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.
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Login to access your submissions.
Please choose 'ReadOnlyMode' if you needn't to 'Edit' the problem e.g. viewing OJ's solution, TestCase Files (TCFs), TimeLimit etc.