Max continuous sum problem