프로그램 명: stfd_earthquake
제한시간: 1 초
A major earthquake has turned a beautiful stained glass window at the Farm Hill College chapel into shards of glass lying on the floor. The chapel manager is calling upon you to help him qui
ckly put the window back together. Luckily the window only broke along its lead joints, and the individual colored pieces are all intact. Additionally, as if by divine intervention, all of the pieces landed on t
he floor either in their original orientation, or rotated by a multiple of 90 degrees ( π 2 radians), and no pieces have been flipped on their face.
After much searching, a schematic of the original stained glass window as it stood before the earthquake was
found in the library. You learn from the schematic that no two colored pieces of the window are identical in shape and size. With this schematic in hand, your mission is to write a pro
gram that will identify the strewn shards to help reassemble the window.
입력
Each comprising a description of a broken window for you to reassemble.
-
Every test case begins with a single line containing an integer n (1 ≤ n ≤ 20), the number of individual glass pieces in the window.
- The next n lines each contain a description of a unique colored glass piece in the form of a simple polygon with nonzero area. The coordinates of the
k (3 ≤ k ≤ 100) vertices of each polygon will be given in counter-clockwise order in the following format:
x1 y1 x2 y2 ... xk yk x1 y1 .
You may assume that the vertices of each polygon are distinct, i.e., (xi , yi) ≠ ( xj , yj) whenever i ≠ j , and consecutive vertices are not collinear. All coordinates are integers restricted to
the range 0 ≤ xi , yi ≤ 100.
-
The final line of each test case is the schematic of the original window, written
as a concatenation of n non-overlapping polygons in the same format described above. Each of the poly gons in the schematic is
guaranteed to correspond to some rotation plus translation of one of the glass pieces described above.
출력
For every glass piece in the input for a test case, write a single integer indicating the position within the schematic that the piece appears.
입출력 예
입력
2
1 3 4 3 1 5 1 3
4 4 4 7 2 7 4 4
0 0 2 0 2 3 0 0 2 0 4 0 2 3 2 0
출력
1 2
입력
4
0 0 4 0 4 2 2 2 0 0
0 0 4 0 2 2 0 2 0 0
4 4 0 4 2 3 4 4
0 4 4 4 2 6 0 4
0 0 4 0 2 2 0 0 0 0 2 2 2 4 0 4 0 0 2 2 4 0 4 4 2 4 2 2 0 4 4 4 2 5 0 4
출력
3 2 4 1
출처:standford/2008/
[질/답]
[제출 현황]
[푼 후(0)]