Initial break in Power of 2 problem

How to choose initial break in https://codeforces.com/contest/1095/problem/C problem

Hi @rk221_b
first make a list of all powers of 2 i.e make this set by finding all set bits.
9=1001b, hence 9={1,8}
now u just hv to break the biggest elements of set into 2 parts like 8->4,4. this will increase the size of list by 1.
make sure u first check whether u can represent a number in k powers of 2 or not.

refer to dis code for more help.


Hope dis helps

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.