Scheduling unit tasks to minimize the number of idle periods: a polynomial time algorithm for offline dynamic power management | Synapse