Optimal Allocation Of Resources