Class Assignment @hb

https://hack.codingblocks.com/contests/c/452/875
https://ide.codingblocks.com/s/33570

https://ide.codingblocks.com/s/33765

I have made quite a lot changes and now it is producing correct answer.
But it is of complexity O(T*2^N) which is huge and produce TLE.

Try optimising it and think of dp and bottom up approach.

https://ide.codingblocks.com/s/33766

here is my solution in O(T) approach.