Given as input, a sorted array of floats, I need to find the total number of pairs (i,j)
such as A[i]*A[j]>=A[i]+A[j]
for each i < j
How about excluding all floats that less then 1.0 first, since any number multiple with number less than 1, the x*0.3=A[i]+A[j] for each i < j, so we only need to count numbers of array to calculate the number of pairs(i, j), we can use formula about permutation and combination to calculate it. formula should be n(n-1)/2.