possible bin packing question what is known: you are given 3 packs of boards of different lengths. ie pack A is 3.9m, B is 3m and C 2.4m  and an arbitrary distance to cover, d. how do I pose and then solve this question?
3.9A + 3B + 2.4C ~= d ??
obviously A, B and C are positive, integer values and the aim is to get as close to d as possible.
n.b this is real life problem I encounter most days and normally solve by trial and error

You can solve the problem via mixed integer linear programming as follows.  Let $S\ge 0$ and $T \ge 0$ be surplus and slack variables, respectively.  The problem is to minimize $S+T$ subject to
$$3.9 A + 3 B + 2.4 C - S + T = d.$$
