POJ 2442 Sequence
来源:互联网 发布:charles汉化破解版mac 编辑:程序博客网 时间:2024/05/18 00:51
F - Sequence
Time Limit:6000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescription
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?
Input
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.
Output
For each test case, print a line with the smallest n sums in increasing order, which is separated by a space.
Sample Input
12 31 2 32 2 3
Sample Output
3 3 4
0 0
- POJ 2442 Sequence
- POJ 2442 Sequence
- POJ 2442 Sequence(堆)
- POJ 2442 Sequence【堆】
- poj 2442 Sequence
- POJ 2442 Sequence
- POJ - 2442 Sequence
- POJ 2442 Sequence
- Poj 2442 Sequence
- 【POJ 2442】Sequence
- poj 2442 Sequence
- POJ 2442 Sequence
- Sequence(POJ--2442
- poj-2442Sequence
- poj 2442 Sequence
- poj 2442 Sequence
- POJ-2442-Sequence
- POJ-2442 Sequence
- HDU 4923 Room and Moor
- 开篇词
- 这一年,我在创业路上
- codeforces B. Pasha Maximizes
- ThreadingMixIn与HTTPServer
- POJ 2442 Sequence
- STL学习之LIST
- 完全背包
- Android BadTokenException 问题解决
- java位运算符(练习)
- 初学者之Android HelloWorld项目
- 上海传智播客JAVASE_day04学习笔记
- Web Api 图片上传
- 一些我想干的活