 Amicable Pair
##### Submissions: 2397   Accuracy: 56.86%   Difficulty: Easy   Marks: 2

Amicable numbers are two different numbers so related that the sum of the proper divisors of each is equal to the other number. (A proper divisor of a number is a positive factor of that number other than the number itself.

Input:
The first line consists of an integer T i.e. the number of test cases. First and the last line of each test case consists of two integers x and y.

Output:
Print '1' if the following pair is amicable pair otherwise print '0'.

Constraints:
1 <= T <= 100
1 <= x,y <= 105

Examples:
Input:

2
220 284
1 2

Output :
1
0

Explanation :
Test Case 1 : Proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55 and 110. Sum of these is 284. Proper divisors of 284 are 1, 2, 4, 71 and 142 with sum 220.

#### ** For More Input/Output Examples Use 'Expected Output' option **

Contributor: S_A
Author: saksham0751

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.