Minimize sum with halving operations | Oracle