Ordering Qty fw27 fw28 fw29 fw30 fw31 . . . . .fw39
250 16 16 16 16 16.............16

Suppose my ordering quantity is 50 units, I need to know how many orders I need to place on which fiscal week?

For this particular demand pattern, my total ordering quantity will be 250.
Demand is averaged for production as 16 units.

Objective : Optimally order the quantity in consistent with the demand per week

For ex: For the 1st product requirement, it is 250 units across the 13 weeks from FW 27 to FW 39
But I can order in all combinations , like 5 times 50 units w r to demand or 100, 100, 50 according to the demand, or 150, 50, 50 etc etc
This shows there are lots of combination possible.

Now suppose If I freeze, minimum ordering quantity fixed as ordering size, then according to the requirments I wil be ordering 5 times in a span of 13 weeks
Hence I need to know how to obtain ordering pattern based on demand requirments and also need to get in which fiscal week I will be getting my orders ?
Could somebody help me in writing macro code for this ?