Pair Pain Problem Code: PAIRPAIN | CodeChef Solution | Python3

Veröffentlicht am: 16 April 2022
auf dem Kanal: Python Coder
2,324
9

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.


Auf dieser Seite können Sie das Online-Video Pair Pain Problem Code: PAIRPAIN | CodeChef Solution | Python3 mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Python Coder 16 April 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 2,324 Mal angesehen und es wurde von 9 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!