Company: Hackereartth_2_Feb
Difficulty: medium
Array-Difference Problem Statement You are given an array of integers. You are interested in finding out the maximum absolute difference between any 2 elements in the array. But you want to minimize this maximum absolute difference. You can perform the following two types of operation on the array elements any number of times. If the element E is even then you can replace it by E /2. If the element E is odd then you can replace it by 2* E . Can you help him minimize this maximum absolute difference? Input Format The first line consists of a single integer T , the number of test cases. Each test case consists of 2 lines. The 1st line has an integer N , the number of elements in the array. The next line has N space-separated integers, denoting array elements. Output Format For each test case, output in a separate line, the answer to the given question. Constraints 1 ≤ T ≤ 500 2 ≤ N ≤ 50000 1 ≤ A[i] ≤ 10 6 for each valid i It is guaranteed that the summation of N over al