#C2303. Determining the Correct Order of Books

    ID: 45605 Type: Default 1000ms 256MiB

Determining the Correct Order of Books

Determining the Correct Order of Books

You are given n books which are meant to be arranged in increasing order from 1 to n. However, due to a mix-up, the books might not be arranged in order. In an interactive version of the problem, you could query the server with a range [l, r] to know the number of books that are out-of-order in that segment. In this problem, you do not actually need to perform any queries; the correct order of the books is simply the natural increasing order from 1 to n.

Your task is to print the correct order of the books in a specific format. The output should begin with an exclamation mark followed by the sequence of book numbers separated by spaces. For example, if n = 5, the correct output is:

! 1 2 3 4 5

Note: While the problem statement mentions querying a server for additional information, no queries are required for the solution. The intended solution is to simply output the natural sorted order.

inputFormat

The input is read from standard input (stdin) and consists of a single integer n on the first line representing the number of books.

Input Format:

  • The first line contains a single integer n (1 ≤ n ≤ 105).

outputFormat

The output should be printed to standard output (stdout) in a single line. It must start with an exclamation mark ! followed by a space and the sequence of book numbers in increasing order, each separated by a single space.

Output Format:

  • A single line in the format: ! 1 2 3 ... n.
## sample
5
! 1 2 3 4 5