Input: arr[] = {2, 6, 3, 4, 8, 9}
Output: 4
Explanation: In the above example, the ratios of every pair are calculated likewise between 2 and 6 (1:3), 2 and 3 (2:3), 6 and 3 (2:1), 3 and 4 (3:4), 4 and 8 (1:2) and so on. Here the minimum ratio sum is 3 i.e., (1:2 or 2:1) where the pairs like [6, 3], [2, 4] and [4, 8] have the above ratio, and even in them the maximum absolute difference is 4 i.e.,
abs(4-8) = 4
Input: arr[] = {5, 9, 10, 18, 12};
Output: 9
Explanation: The pair [9, 18] is having minimum ratio sum of 3(1:2) and a maximum absolute difference of 9.