Odd GCD codechef solution
Contest Code: START14B Problem Code: BININVER You are given an array A 1 , A 2 , … , A N A 1 , A 2 , … , A N consisting of N N integers. Your goal is to make the GCD of all the elements in the array an odd integer. To achieve this goal, you can do the following operation any number of times: Choose an index i ( 1 ≤ i ≤ N ) i ( 1 ≤ i ≤ N ) such that A i > 1 A i > 1 and set A i = ⌊ A i 2 ⌋ A i = ⌊ A i 2 ⌋ You can choose an index multiple times during the operations. Find the minimum number of operations after which GCD of all the elements in the array becomes an odd integer. Note: ⌊ x ⌋ ⌊ x ⌋ : Returns the largest integer that is less than or equal to x x (i.e rounds down to the nearest integer). For example, ⌊ 1.5 ⌋ = 1 , ⌊ 2 ⌋ = 2 , ⌊ 1.5 ⌋ = 1 , ⌊ 2 ⌋ = 2 , ⌊ 7 2 ⌋ ⌊ 7 2 ⌋ = ⌊ 3.5 ⌋ = ⌊ 3.5 ⌋ = 3 = 3 . Input Format The first line of t...