DOR - Editorial

DjrmFx - Online C++0x Compiler & Debugging Tool - Ideone.com. can u please help me brother i am not getting y its wrong nd it is giving wa for 4th testcase.

why i m getting wrong answer in this.I have did exactly what explained in the editorial.Can anyone help.Here is link to my solution.
https://www.codechef.com/viewsolution/27637908

I am not able to understand the editorial. can someone please make it a bit more simple?

Great Editorial

But I have used ceil(pow(2,i)) but it is showing WA . then i changed to
(long long )(pow(2,i)+0.5) then got AC .
any idea why it is WA for first time

long long int ans = ceil(pow(2.5,4));
long long int ans2 = (pow(2.5,4) + 0.5);
cout <<ans << " " << ans2 << endl;

I think this must be self-explanatory. Run this and check out the output. You’ll learn about ceil.