The paper gives a simple algorithm for finding optimal allocations subject to a hierarchy of limits when the loss function is separable strictly convex and the resources function is linear. Its applications to capital budgeting and multistage sampling are pointed out.