#P9508. 『STA - R3』存在
『STA - R3』存在
Problem Description
Construct a sequence of length such that every subarray of length at least has a majority element. Based on this, maximize the number of distinct values in the sequence. The majority element of a sequence is defined as a number whose occurrence count is at least half of the sequence length.
Each element in your constructed sequence must be an integer between and .
Input Format
One line containing a positive integer .
Output Format
One line containing integers, representing the sequence you constructed. If there are multiple answers, output any one of them.
3
1 1 2
Hint
This problem uses bundled tests.
Constraints:
- Subtask 1 (10pts): .
- Subtask 2 (40pts): is a multiple of .
- Subtask 3 (50pts): No special restrictions.
For all data, .
Translated by ChatGPT 5