#K75407. Minimized Permutation
Minimized Permutation
Minimized Permutation
Given a positive integer n, output a permutation of the integers from 1 to n such that the sum of the absolute differences of consecutive elements is minimized. It can be proved that the increasing order sequence minimizes the sum of differences, which is exactly n - 1.
Input: A single integer n.
Output: The permutation of numbers from 1 to n (in increasing order) separated by spaces. The output should be printed on a single line.
Example:
Input: 5</p>Output: 1 2 3 4 5
Note: Use standard input (stdin) to read input and standard output (stdout) to print the result.
inputFormat
A single integer n (1 ≤ n ≤ 100000).
outputFormat
A permutation of integers from 1 to n in increasing order, printed as space-separated values on one line.## sample
1
1
</p>