Scheduling

Four jobs must be processed on a single machine. Each has a processing time and a due date. The delay of a job is the number of units after the due date it is completed (or 0 if it is completed on time.) In what order should the jobs be processed in order to minimize the total delay.
Job Processing Time Due Date
1 6 8
2 4 4
3 5 12
4 8 16