qty / (cost * ppl) . qty cost ppl.
, - (python):
def cmp(a, b):
return (a["qty"] / (a["cost"] * a["ppl"])) - (b["qty"] / (b["cost"] * b["ppl"]))
list = sorted(list, cmp)
: , , qty , cost * ppl . , a/x > b>x, a > b. ; x/a > x/b, a < b, cost ppl (, , 100 , , 100/2 = 50 $. , 100/3 ~ = 33 $, ). (, , )