How do you solve this [1,5,9,4] pair numbers problem?
This can be done in $O(n^2 \space log \space n)$.


Insert all N array elements with the indexes into a balanced BST.
For every $i \in \{0,...N-1\}$
For every $j \in \{0,...N-1\} \space and \space j \ne i$
Search for $(A[i]+A[j]),(A[i]-A[j]),(A[i]*A[j]),(A[i]/A[j])$ in the BST and add $(A[i],A[j])$ if it is found in the BST and  its corresponding BST entry $index \ne i\space and \space j$

Steps 1 and 2 runs for $O(n)$ time.
Step 2 runs for $n-1$ times = $O(n)$.
Step 3 runs for $4*log\space n = O(log\space n)$.
Hence, time complexity is $O(n^2\space log \space n)$.