Good Pair
CodeChefOpen on judge ↗
Given an array of $N$ elements $A_1,A_2,A_3...A_N$. A pair $(A_i,A_j)$ is said to be good if $i<=j$ and $A_i-A_j=A_i*A_j$. Find the number of good pairs in the array. ###Input: - First line will contain $T$, number of testcases. Then the testcases follow. - Each testcase contains of two lines of input, an integer $N$ and $N$ space separated integers $A_1,A_2,A_3...A_N$. ###
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start