#3560

Find Minimum Log Transportation Cost

pupil · 495 · lc easy +27 · 42.2% accepted · 59 likes · top 23%

Description

Two logs of lengths n and m must be loaded into three trucks, each with a maximum capacity of k. Cutting a log of length x into pieces len1 and len2 costs len1 * len2.

Return the minimum total cutting cost needed to fit all log pieces onto the trucks (cost is 0 if no cuts are needed).

Code

1
2
3