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.
На этой странице сайта вы можете посмотреть видео онлайн Pair Pain Problem Code: PAIRPAIN | CodeChef Solution | Python3 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Python Coder 16 Апрель 2022, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 2,324 раз и оно понравилось 9 зрителям. Приятного просмотра!