How many full batches fit a pan
Integer parts are weighed into the largest number of full batches that fit a pan, and the remainder is what does not fit.
Each line also carries a cost per unit of weight, so the desk counts what one batch, the placed blend and one unit of blend cost, in whole cents.
The result appears here when the page script runs.
How it is computed
Method
Let the parts sum to T. The batch count is the greatest integer B with B times T at most the pan. Placed units are B times each part. The remainder is pan minus the placed total. Shares are the reduced ratios of the parts over T. The weighing step is the gcd of the parts.
A line costs its parts times its cents per unit; one batch costs the sum over the lines, and the placed blend costs that sum times the batch count, checked against the line-by-line total. One unit of blend costs the batch cost over T, kept as a reduced fraction of a cent, and its nearest cent rounds a half upward. Every amount is a whole number of cents, so no money passes through floating point.
Assumptions
A part is an unnamed unit. Mixing is ideal. Order is the order typed. A zero batch is a defined result: nothing was placed, and the remainder is the pan.
Limits
A line is an unnamed unit, so the result is arithmetic rather than a recipe, a supplier quote, a nutrition figure, or a safety limit. The remainder carries no cost because it is not placed.
Reproducibility
The inputs are kept in the address bar, so the same link reruns the same calculation. An address without costs takes the default costs in order.