Type : Greedy
This is a classical problem about n machine consistently handling m jobs.
Let, packing the i-th pizza takes ai unit time and the delivery time is equal to bi.
Now, Look for the smallest among the numbers ai and bi (i=1,n). If the lowest value is ai then put the i-th pizza for processing first, if bi the latter. Then remove the i-th pizza from the list, repeat this process for the remaining (n-1)th pizza.
Note that the chef will not wait if the delivery time is longer for the i-th pizza.
Soln :