Puzzle I 急急急

来源:百度知道 编辑:UC知道 时间:2024/06/04 20:04:10
Puzzle is a very intersting game, especially when you want to show your wisdom in front of girls. Now your job is to restore some puzzles. Let's consider a simple case. A puzzle has a few small blocks, each block is a 3*3 matrix. All the elements in our problems are capital letters. You can only shift the blocks but never rotate them.

Input

The first line is an integer n(n<=10) which shows the number of cases. For each case,the first line is an integer m(m<=5) denoting the puzzle has m rows and each row has m blocks.Then it follows a 3m*3m matrix which is the original puzzle.The followings are all the m*m blocks in this case with the block ID (an integer from 1 to m*m) in the first line of each block.

Output

For each case you must print the right order of block IDs seperated by a single blank in a single line, so that we can restore the puzzle row by row from left to right.Notice that there mustn't be any extra blank in your ans

这么多英文,我懒得看了,虽然我的英文也很好

楼主你先把它翻译成中文吧,这是c/c++板块嘛

??????????????????????????????????????????

ACM ICPC可以上网吗?真奇怪……
直接求代码啊,那你参加竞赛究竟是为什么呢?