#K94172. Minimum Moves in a Circular City

    ID: 38583 Type: Default 1000ms 256MiB

Minimum Moves in a Circular City

Minimum Moves in a Circular City

You are given a circular city with N districts arranged in a circle. Each district has a certain number of points of interest, but this information is not used in the computation.

Your task is to determine the minimum number of moves required to visit all the districts at least once. You can start from any district, and in one move you can transition to an adjacent district. Mathematically, if you denote the number of districts as \(N\), then the minimum number of moves required is \(N - 1\).

For example:

  • If \(N = 4\), then the answer is \(3\).
  • If \(N = 1\), then the answer is \(0\).

Note: Although the list of points of interest is provided as input, it does not affect the result.

inputFormat

The first line contains an integer \(N\) representing the number of districts. The second line contains \(N\) space-separated integers representing the points of interest in each district.

outputFormat

Output a single integer which is the minimum number of moves required to visit all the districts.

## sample
4
3 0 2 4
3