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.
In questa pagina del sito puoi guardare il video online Pair Pain Problem Code: PAIRPAIN | CodeChef Solution | Python3 della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Python Coder 16 aprile 2022, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 2,324 volte e gli è piaciuto 9 spettatori. Buona visione!