当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2442:Sequence

题目描述
Given m sequences, each contains n non-negative integer. Now we may select one number from each sequence to form a sequence with m integers. It's clear that we may get n ^ m this kind of sequences. Then we can calculate the sum of numbers in each sequence, and get n ^ m values. What we need is the smallest n sums. Could you help us?
输入解释
The first line is an integer T, which shows the number of test cases, and then T test cases follow. The first line of each case contains two integers m, n (0 < m <= 100, 0 < n <= 2000). The following m lines indicate the m sequence respectively. No integer in the sequence is greater than 10000.
输出解释
For each test case, print a line with the smallest n sums in increasing order, which is separated by a space.
输入样例
1
2 3
1 2 3
2 2 3
输出样例
3 3 4

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 POJ Monthly,Guang Lin

源链接: POJ-2442

最后修改于 2020-10-29T06:32:35+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000 65536