F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Problem Select

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)
Total Submission(s): 712    Accepted Submission(s): 343


Problem Description
HOJ is an online judge system for students in HIT to practice. As the administrator, you would always setup contests by selecting problems from the problem set. Problem IDs are integers that can be phased by url. For example, the corresponding problem ID of url http://acm.hit.edu.cn/problemset/1001 is 1001.

Now the task is, given n urls, print the smallest k problem IDs in increasing order.
 

Input
The first line of the input contains one integer T (1 ≤ T ≤ 10), indicating the number of test cases.

For each test case, the first line contains two integers, n (1 ≤ n ≤ 1000) and k (1 ≤ k ≤ n).

For the next n lines,each line contains a string indicating the problem’s url. The problem ID is guaranteed to be in range [1,10000] and unique in each case.
 

Output
Output T lines.

For each test case, you should output k numbers in a line, and there shouldn’t be any spaces at the end of the line.
 

Sample Input
2 3 2 http://acm.hit.edu.cn/problemset/1003 http://acm.hit.edu.cn/problemset/1002 http://acm.hit.edu.cn/problemset/1001 4 1 http://acm.hit.edu.cn/problemset/1001 http://acm.hit.edu.cn/problemset/2001 http://acm.hit.edu.cn/problemset/3001 http://acm.hit.edu.cn/problemset/501
 

Sample Output
1001 1002 501
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 07:45:30, Gzip enabled