I am unable to find bug in my code for the problem, http://www.spoj.com/problems/HORRIBLE"/the code is http://ideone.com/3bV9eZ
lazy[2*pos+1]+=lazy[pos]/2; lazy[2*pos+2]+=lazy[pos]/2;
This is not right.