PLEASE HELP WITH HMAPPY1 :(

Can anyone please tell why I am getting WA in HMAPPY 1 problem for my segment tree solution in c++ as described in the editorial.
Problem link : https://www.codechef.com/problems/HMAPPY1/
Solution Link: https://www.codechef.com/viewsolution/26136252

Please provide any test case which my code might fail. Please help I am really frustrated.