Amazon's task distribution systems face this exact problem: schedule jobs with cooldown constraints to minimize total time. This is Amazon's # most-asked problem, testing greedy + heap thinking. You pick the most frequent task each round and idle only when no valid task is available.
Solve it on LeetCode, then check your approach in the full walkthrough. The greedy formula gives you time and space.