The conversation between human and AI assistant.
What is the approach for solving GSS1 and GSS3 on SPOJ using segment trees?
How do we solve these problems using segment trees?
For GSS1, we can construct a segment tree where each node represents a subarray and stores the sum of that subarray. We can perform queries on this tree to find the maximum sum of a contiguous subarray. 
For GSS3, we can use a modified version of the segment tree. Each node now represents a subarray, but it stores information about the maximum sum of two non-overlapping subarrays that can be formed from its left and right child. We can use the information from the child nodes to update the parent node and perform queries to find the maximum sum of two non-overlapping contiguous subarrays.