oj mrJudge
Toggle navigation
  • Login
    • Forget Password
      Login
User Image

Hello, Stranger

Guest
  • Analysis Mode
  • Problems
    • All Problems
    • Latest Problems
  • Join Us Now
  • Registration
  • Contact Us
  • Infomation
  • About
    • Terms of Use
    • Technical Specifications
    • Credits

museum Batch , stdin/stdout

Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

museum.html

The Plovdiv Museum of Modern Art has an exhibition of ancient Thracian vases. There are N vases total. The first one is a miniature of height 1 centimeter. The second one is of height 2 centimeters; the third one is 3 centimeters tall and so on until the Nth vase, which is N centimeters tall.

Since this a modern art museum and the vases are ancient, the organizers of the exhibition would like to add a modern, chaotic twist to the presentation of the vases. They have decided to arrange the vases in a line that satisfies the following condition: For any three vases A, B and C, such that B's height is exactly the average of the heights of A and C, either B must be positioned to the left of both A and C, or B must be positioned to the right of both A and C (in other words, B may not be positioned between A and C on the line).

Task

Write a program that, given the number of vases, determines a linear arrangement of the vases that satisfies the condition of the exhibition organizers.

Constraints

1 ≤ N ≤ 2,000The number of vases

Input

The first and only line contains a singer integer N.

Output

There should be N lines, each representing the N positions in the arrangement, in order from left to right. Line k should contain a single integer Hk, the height of the vase you decided to place on position k. All N heights should be distinct integers between 1 and N inclusive.

Sample Input 1

5

Sample Output 1

3
1
2
5
4

Explanation for Sample Output 1

In the above arrangement, 3 is neither between 2 and 4, nor is it between 1 and 5. Also, 2 is not between 1 and 3, and 4 is not between 3 and 5. Thus, it satisfies the condition of the exhibition organizers.

Tags

Ad Hoc

Subtasks and Limits

Subtask Score #TC Time Memory Scoring
110051s32MBAverage
2011s32MBAverage

Judge Compile Command

g++-8 ans.cpp -o museum -Wall -Wshadow -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512

Accepted Submissions

subIDUserTimeMax Time

Past Submissions

subIDUserTimeScore
mrJudge 09.05.20
Copyright © 2020 mrJudge. All rights reserved.