Fenwick tree with binary search help please

https://www.codechef.com/viewsolution/33385192 please help someone
fenwick tree with binary search on it