Pair of points
On a plane, you are given N red points and N blue points, each specified by their coordinates. No three points are collinear. Your task is to create N segments such that no two segments intersect, each segment connects a red point with a blue point, and every point is part of exactly one segment.
Write a program that, given the coordinates of these points, finds a way to pair them into N segments, ensuring each segment connects a red point to a blue point. Each point must be included in exactly one segment, and no segments should intersect.
Input
The first line contains a single integer, representing the number of test cases. Each test case is processed independently. The first line of each test case contains an integer N (1 ≤ N ≤ 2500), indicating the number of points of each color. This is followed by N lines of coordinates for the blue points, and then N lines of coordinates for the red points. Each line contains two integers, representing the x and y coordinates of a point (|x| ≤ 10000, |y| ≤ 10000).
Output
For each test case, output the results consecutively. Each of the N lines for a test case should contain two integers, representing the indices of the blue and red points that are connected by a segment. Points are indexed in the order they appear in the input, separately for each color. If it is not possible to connect the points with non-intersecting segments, output a single line containing the number 0 for that test case.