Monster-Go

면접 대비

시간 제한1초메모리 제한2048 MB

요약
N명의 플레이어에게 50종 몬스터 중 12종씩 배정해, 어떤 방문 순서에서도 승자가 정확히 한 명만 나오도록 한다.
난이도

어려움10점 중 8점

유형
조합론, 수학, 그리디
정답자
아직 제출이 없습니다

문제

Helen and her friends have discovered an amazing new game for their phones. The game, called Monster-Go, is about catching monsters by walking to different monster nests outdoors. There are an infinite number of monsters of a single type available at each nest. When the friends arrive at a monster nest, each of them will catch and add the monster type at that nest to their collection. There are a total of 5050 different monster types that the friends can catch, numbered 0,1,…,490,1,\ldots,49.

To make the game more exciting, the NN friends have decided that each player will have a personalized list of exactly 1212 monster types to collect. The first person to catch all the monsters on their list wins the game. They want to design the lists in such a way that, no matter the order in which they visit the monster nests, there is always a single, unique winner -- never a tie. The friends always walk around together as a group and arrive together at a monster nest.

Can you help them design the lists? Your score will depend on the number of values of NN, the number of people playing, for which you are able to solve the problem.

입력

The first and only line of input contains the integer NN, the number of players.

출력

Output NN lines, where the iith line has 1212 distinct integers c_i,1,c_i,2,…,c_i,12c\_{i,1}, c\_{i,2}, \ldots, c\_{i,12} (where 0≤c_i,j≤490 \le c\_{i,j} \le 49) representing the monster types on the list of person ii. If there are multiple solutions, you may print any of them.

제한

  • 1≤N≤501 \leq N \leq 50.

힌트

In the sample, where there are N=2N = 2 friends, the program should output two lists. Indeed, for the two lists in the sample output, the friends cannot both win at the same time, no matter the order in which they visit the monster nests. Note that there are many other valid answers.

예제1

  1. 예제 1

    입력
    2
    
    예상 출력
    0 1 2 3 4 5 6 7 8 9 10 11
    38 39 40 41 42 43 44 45 46 47 48 49