fix a mistake in yRange
incomplete greedy algorithm