On the optimal allocation of customers that must depart in sequence