#K4056. Minimize Total Distance

    ID: 26669 Type: Default 1000ms 256MiB

Minimize Total Distance

Minimize Total Distance

You are given an integer n representing the number of points arranged in a circular path. You are also given a list of n integers, which denote the distances between consecutive points. Starting from an initial point, you must visit each point exactly once and return to the starting point. The minimized total distance is the sum of all the distances provided.

In mathematical terms, if the distances are given as \(d_1, d_2, \dots, d_n\), the answer is:

[ \text{Total Distance} = \sum_{i=1}^{n} d_i ]

Compute and output the total distance.

inputFormat

The input is read from stdin and contains two lines:

  • The first line contains an integer n, which is the number of points.
  • The second line contains n space-separated integers representing the distances between consecutive points.

outputFormat

Output to stdout a single integer that is the minimized total distance required to complete the roundtrip.

## sample
3
1 2 3
6