When writing game programs, it is often useful to determine when two polygons intersect. This is especially handy in arcade games like Asteroids, where one polygon might represent a spaceship while another represents a huge, unyielding chunk of space rock.
Write a program that determines which polygons in a given set intersect one another.
The first line contains a single integer $n$, the number of datasets. Each dataset has the following form:
x,y ($0 \le x, y \le 100$). The vertices are listed in order; consecutive vertices are joined by edges, and the last vertex is joined back to the first. Every polygon is simple — its edges never cross themselves.For each dataset, print the heading Data Set #z, where $z$ is 1 for the first dataset, 2 for the second, and so on. If the dataset contains no intersecting polygons, print no collisions on its own line. Otherwise, print every pair of intersecting polygons, one pair per line, writing the lower-numbered polygon first. List the pairs in ascending order, sorting first by the lower-numbered polygon and then by the higher-numbered one.
Two polygons intersect if they share an interior region (they overlap) or share boundary points (they touch at a single point or along an edge).