spoj GSS1: finding maximum sum in a range