Material cutting problem

topic description

there are N length specifications for raw materials
for example, there are 9 meters and 12 meters

customers need to cut each M root of N specified length L
for example: 1.2m 200m, 1.3m 80root, 1.33m 120root, 1.78m 90root

find out how many pieces of each material are used, how to cut each one, and minimize waste

how should this algorithm be abstracted and analyzed?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e5ccf8-456ce.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e5ccf8-456ce.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?