Optimal timing and lot-sizing of jobs on a single machine