A Generalized Cost Allocation Scheme