#C7078. Minimal Delivery Cost
Minimal Delivery Cost
Minimal Delivery Cost
You are given an integer n representing the number of cities arranged along a number line at positions 1 through n. Your task is to determine the minimum cost to start at one city, visit every city exactly once, and return to the starting city. The cost of traveling between any two cities is the absolute difference of their positions. It can be shown that the minimum cost is achieved by visiting the cities in order, which yields a total cost of \(2\times(n-1)\).
Input: A single integer n.
Output: A single integer representing the minimum delivery cost.
inputFormat
The input consists of a single line containing one integer n (1 ≤ n ≤ 106).
outputFormat
Output a single integer, which is the minimum delivery cost calculated as \(2\times(n-1)\).
## sample1
0
</p>