Most cost efficient length for pneumatic hoses?
Here are all the 4 mm diameter pneumatic tube parts Bricklink knows about.
For each of these (filtered by color if necessary) we can take the part (for example Hose, Pneumatic 4mm D. 40L / 32.0cm), check its average sale price in the &quot;Price Guide&quot; tab (in this case at the time of writing US $2.66), then divide that by the length to get the unit price (US $0.044 for a LEGO unit or $0.083 for a cm). Repeating the process for all available lengths will result in a list of unit prices, sorting that gives you the best price to length ratio.
Or if you are looking to buy the cheapest piece from which the most 12cm pieces can be cut, you can then perform an integer division on the original length and arrive at the price of a single 12cm part for each avaialble length. For example, the 32 cm piece above nets you 2 pieces of 12cm lengths, so its unit price is $1.33. Whereas the 428 cm piece is currently on sale for $53.05, and can be cut into 35 pieces of the desired 12cm length, so it gives us $1.51 as unit price.
For reference, the actual 12cm piece costs on average $7.45, but the twice as long 24 cm one is sold for $0.75 on average, so there seems ot be no easy way besides checking and calculating the relevant prices for each available length.
The actual computations and sorting I leave to you or to other site contributors.