maximum sum sequence (spoj -MAXSUMSQ)