def maxSubarray(l):
	"""returns (a, b, c) such that sum(l[a:b]) = c and c is maximized"""
	best = 0
	cur = 0
	curi = starti = besti = 0
	for ind, i in enumerate(l):
		if cur+i > 0:
			cur += i
		else: # reset start position
			cur, curi = 0, ind+1

		if cur > best:
			starti, besti, best = curi, ind+1, cur
	return starti, besti, best