Time limit
3000 ms
Memory limit
262144 kB
Source
Codeforces Round #496 (Div. 3)
Tags
brute force greedy implementation *1400
Editorial
Tutorial
Descriptions:

Summarize to the Power of Two

CodeForces - 1005C