프로그램 명: 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.

출력

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)]
[ 채 점 ] [홈으로]  [뒤 로]