Company: Hackerearth_1nov
Difficulty: medium
Array-Difference Problem Description Mark has an array of N elements of positive integers. He is interested in finding out the maximum absolute difference between any 2 elements in the array. But he wants to minimize this maximum absolute difference. He can perform the following two types of operation on the array elements any number of times: If the element E is even then he can replace it by E/2. If the element E is odd then he can replace it by 2E. 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. 1st line has an integer N , the number of elements in the array. 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^9 for each valid i It is guaranteed that summation of N ov