题意:截取一堆的木块,花费的时间的规律是:
a) The setup time for the first wooden stick is 1 minute.
(b) Right after processing a stick of length l and weight w , the machine will need no setup time for a stick of length l' and weight w' if l <= l' and w <= w'. Otherwise, it will need 1 minute for setup.
既:若按照这样的顺序截取(2,5)(1,2)需要2分钟。
而按照这样的顺序(1,2)(2,5)只需要一分钟。
输入:
首先是测试的个数,然后是输入有几个木块,然后依次输入每个木块的l,w。
输出:
花费的最短的时间。
难度:比较简单。
代码: