A Group Utility Function by Optimal Allocation