Marcus is trying to create yet another data structure problem! The problem statement is as follows:
In the land of DMOJistan, citizens live in cities along a number line, conveniently numbered from to . The city is at position and has a population of .
As a member of the PEG (political espionage group), you have been tasked with ensuring that one city holds a majority of the power. Specifically, you will readjust the borders of DMOJistan to only contain the cities in the range . How many pairs are there such that the city with the greatest population in the range has strictly greater than half the total population of the range?
Marcus attempted to create strong data for this problem, but Edward kept finding ways to cheese it. After Marcus gave up, Edward suggested that the data generation could be a problem in and of itself! Edward quickly finds an optimal construction, but Marcus has no idea what to do. Can you help him?
Your job is to construct an array of integers in the range , such that the answer to the above problem statement is as large as possible. Your score will be calculated based on how close you get to the maximum achievable number of pairs.
Constraints
For all subtasks,
is a variable used for scoring. (More details in the scoring section).
Subtask 1 [30%]
Subtask 2 [70%]
Input Specification
The first and only line of input contains one integer, , the desired length of the array.
Output Specification
Output one line containing space-separated integers in the range , your constructed array.
Scoring
If you do not output integers in the range or your output is formatted incorrectly, you will receive a Wrong Answer verdict.
Otherwise, let be the number of pairs in your array. Let be the maximum number of pairs across all possible arrays. Your score will be calculated as
where is the scoring variable defined for each subtask. Your score for a subtask is the minimum of the scores of all of the tests within the subtask.
Sample Input
6
Sample Output
3 1 4 1 5 9
Explanation for Sample
There are valid pairs in this construction:
A pair such as is not counted since is not strictly greater than .
It can be shown that this construction is not optimal.
Comments