name$[] = [ "beef" "pork" "ham" "greaves" "flitch" "brawn" "welt" "salami" "sausage" ]
wgt[] = [ 3.8 5.4 3.6 2.4 4.0 2.5 3.7 3.0 5.9 ]
val[] = [ 36 43 90 45 30 56 67 95 98 ]
maxwgt = 15
# 
n = len wgt[]
# 
for i = 1 to n - 1
   for j = i + 1 to n
      if val[j] / wgt[j] > val[i] / wgt[i]
         swap val[j] val[i]
         swap wgt[j] wgt[i]
         swap name$[j] name$[i]
      .
   .
.
for i to n
   w = lower wgt[i] maxwgt
   print w & " kg " & name$[i]
   maxwgt -= w
   if maxwgt = 0
      break 1
   .
.
