Maximum sum query

gettin run error in 2 caes.
ide:https://ide.codingblocks.com/s/190049

@Vishal123
hello Vishal,
your code is correct,just increase the size of ur array
image

getting wrong answer in first two cases and right answer in last two cases . ide : https://ide.codingblocks.com/s/193456

@Vishal123
i have increased tree size as well .
pls submit again
https://ide.codingblocks.com/s/193477