Hi, I was trying to solve the spoj-GSS1 problem(link). I can realize that I have to keep four information in each node of the segment tree (maxsum, prefixsum, suffixsum and sum). I have read this tutorial and has no problem in building the tree. I am facing some difficulties with the queries. Please someone explain how to answer the queries.
 can help you understand everything :). : https://ideone.com/XUtwzc