Logo
(追記) (追記ここまで)

34872번 - Triple Fairness 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB108968989.899%

문제

This problem adopts exactly the same definition of Fair Problemset as Problem H, “Fair Problemset”.

ICPC is a team competition. Each team has three members. At the beginning of a contest, most teams divide the 3ドルn$ problem evenly. They use one of two common methods to distribute problems:

  1. Sequential Distribution: Each member takes a contiguous block of $n$ problems from the set of 3ドルn$ problems. Specifically, the first member takes problems 1,ドル \cdots , n,ドル the second member takes problems $n + 1, \cdots , 2n,ドル and the third member takes problems 2ドルn + 1, \cdots , 3n$.
  2. Jump Distribution: Each member takes problems with indices that have the same remainder when divided by 3ドル$ from the set of 3ドルn$ problems. Specifically, the first member takes problems 1,ドル 4, 7, \cdots , 3n − 2,ドル the second member takes problems 2,ドル 5, 8, \cdots , 3n − 1,ドル and the third member takes problems 3,ドル 6, 9, \cdots , 3n$.

The ICPC Seoul Regional Contest Scientific Committee must prepare a problemset consisting of 3ドルn$ problems. The difficulty of each problem is represented by an integer from 1ドル$ to $n,ドル inclusive. For each difficulty, there are exactly three problems with that difficulty. Thus, the arrangement of difficulties in the problemset can be viewed as a difficulty sequence of length 3ドルn$ containing three problems of each of the $n$ difficulty levels.

To prevent any advantage or disadvantage for a team based on their chosen problem distribution method, the ICPC Seoul Regional Contest Scientific Committee has defined a standard called a Fair Problemset. A difficulty sequence of length 3ドルn$ is called a Fair Problemset if it satisfies both of the following conditions:

  1. Sequential Distribution Fairness: When using Sequential Distribution, for every difficulty level $i$ (1ドル ≤ i ≤ n$), each of the three members receives exactly one problem with difficulty $i$.
  2. Jump Distribution Fairness: When using Jump Distribution, for every difficulty level $i$ (1ドル ≤ i ≤ n$), each of the three members receives exactly one problem with difficulty $i$.

In other words, regardless of which of the two methods is chosen, each team member must be assigned exactly one problem for each difficulty level from 1ドル$ to $n,ドル inclusive.

Given a positive integer $n,ドル write a program to find any Fair Problemset sequence of length 3ドルn$.

입력

Your program is to read from standard input. The input consists of exactly one line. The line contains an integer $n$ (1ドル ≤ n ≤ 200$; $n$ is not divisible by 3ドル$). It can be shown that for every valid input, there exists at least one Fair Problemset sequence of length 3ドルn$.

출력

Your program is to write to standard output. Print exactly one line consisting of 3ドルn$ space-separated positive integers, representing a Fair Problemset sequence of length 3ドルn$. Any valid Fair Problemset sequence of length 3ドルn$ will be accepted.

제한

예제 입력 1

2

예제 출력 1

1 2 1 2 1 2

예제 입력 2

4

예제 출력 2

1 2 3 4 1 4 2 3 1 3 4 2

노트

출처

ICPC > Regionals > Asia Pacific > Korea > 2025 ICPC Asia Seoul Regional M번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /