C. Ivan and Powers of Two time limit per test 0.5 seconds memory limit per test 256 megabytes input standard input output standard output Ivan has got an array of n non-negative integers a1, a2, ..., an. Ivan knows that the array is sorted in the non…