Allocating multiple inputs, least-cost profit maximizing combination of inputs, and determination of wages in perfect and monopsonistic markets