Hard
Given an array nums of positive integers, you may repeatedly apply two operations any number of times: if an element is even you may halve it, and if an element is odd you may double it. The deviation is the difference between the maximum and minimum elements. Return the minimum possible deviation.
Input: nums = [1,2,3,4] Output: 1
Input: nums = [4,1,5,20,3] Output: 3
Input: nums = [2,10,8] Output: 3