Assembly Required

本文描述了一个关于公主Lucy需要新灯具的故事。城堡从Slick Lamp Parts Company订购了多种可互换的灯具部件,每种类型都有多个。制作灯具需要每种类型的一个部件,而公主对每个部件都有不同的喜好值。任务是为公主提出她最不喜欢的k种灯具组合,输出这些组合的喜好值,按非递减顺序排列。问题可以通过多组背包的算法解决。
摘要由CSDN通过智能技术生成

题目描述

Princess Lucy broke her old reading lamp, and needs a new one. The castle orders a shipment of parts from the Slick Lamp Parts Company, which produces interchangable lamp pieces.
There are m types of lamp pieces, and the shipment contained multiple pieces of each type. Making a lamp requires exactly one piece of each type. The princess likes each piece with some value, and she likes a lamp as much as the sum of how much she likes each of the pieces.
You are part of the castle staff, which has gotten fed up with the princess lately. The staff needs to propose k distinct lamp combinations to the princess (two lamp combinations are considered distinct if they differ in at least one piece). They decide to propose the k combinations she will like the least. How much will the princess like the k combinations that the staff proposes?

 

输入

The first line of input contains a single integer T (1 ≤ T ≤ 10), the number of test cases. The first li

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值