4039 - Random Simple Polygon   

Description

Given N (3 <= N <= 10,000) non-collinear triplewise points on a 2-D plane, select K (3 <= K <= N) points and order them such that the ordered points form a simple K-sided polygon. A polygon is called simple if no pair of its sides cross each other.

Input

First line of the input contains a positive integer T (1 <= T <= 10), the number of cases. Follows afterwards are the description of each case. For each case, the first line contains two integers N and K. Each of Nfollowing lines contains two integers, xi, yi (1 <= xi, yi <= 1,000,000), one of the given points. For simplicity, all points are numbered from 1 to N according to the order of appearance in the input. There is no blank line separating each case.

Output

For each case, output K integers, each on a line, the selected points in the order how the K-sided simple polygon is constructed. If there are more than one possible ordered selection that fits the criteria, output any one. It is always possible to form at least one simple K-sided polygon. There is no blank line separating each case.

Sample Input  Download

Sample Output  Download

Tags




Discuss