You are given an array A containing N positive integers. Find the number of pairs (i,j) such that and:
Input Format
The first line contains an integer T denoting the number of test cases. The T test cases then follow.
The first line of each test case contains an integer N.
The second line of each test case contains N space-separated integers A1,A2,…,AN.
Output Format
For each test case, output on a new line the required answer.
Sum of N over all cases won't exceed 2⋅105
Sample Input 1
2
3
1 3 4
5
2 3 4 5 6
Sample Output 1
2
0
Explanation
Test case 1: The two pairs are (1,2) and (1,3), because:
A1+A2=4 3=A1⋅A2
A1+A3=5 4=A1⋅A3
Test case 2: No pairs satisfy the condition.
On this page of the site you can watch the video online Pair Pain Problem Code: PAIRPAIN | CodeChef Solution | Python3 with a duration of hours minute second in good quality, which was uploaded by the user Python Coder 16 April 2022, share the link with friends and acquaintances, this video has already been watched 2,324 times on youtube and it was liked by 9 viewers. Enjoy your viewing!