Given n points in the plane with target degrees di where ∑di=2n−2, draw a straight-line tree without crossings so each point pi has degree di. Output any valid edge list.
The first line contains T. Each test case has n (4≤n≤1000) followed by n lines with xi, yi, and di.
For each test case print n−1 edges as two indices per line. Any valid solution is accepted.