Let be the time periods numbered backwards and let g n be the number of gallons of fresh milk you will receive in period n . The dairy farmers have been paid in advance. Upon receiving milk, you have it processed and either delivered to one of the chains or put into refrigerated storage. Milk can be left in storage for only one time period before it must be delivered or discarded. There is no cost for discarding milk.
Storage capacity is G gallons.
Likewise, let E 2, n denote the demand from chain 2. You do not have to supply the full demand. Let p 1 denote the percentage. Your goal is to maximize total profit.