Problem 1665 · Hard
Sort tasks by their slack, minimum minus actual, so the tightest starts come before energy is spent.
Open the interactive visualisation