#K62692. Card Passing Time Calculation

    ID: 31588 Type: Default 1000ms 256MiB

Card Passing Time Calculation

Card Passing Time Calculation

You are given N children in a line and a card that needs to be passed from the last child to the first child. Each pass takes T seconds. Although you are provided with the positions of the children, the calculation does not depend on their positions. The total time required for the card to reach the first child is calculated as:

\(\text{Total Time} = (N - 1) \times T\)

For example, if there are 5 children and each pass takes 2 seconds, the total time required is \( (5 - 1) \times 2 = 8 \) seconds.

inputFormat

The input is read from stdin and consists of three parts:

  1. The first line contains an integer \(N\) representing the number of children.
  2. The second line contains \(N\) space-separated integers representing the positions of the children (this data is not used in the calculation).
  3. The third line contains an integer \(T\) representing the time (in seconds) each pass takes.

outputFormat

Output a single integer to stdout which is the total time required for the card to reach the first child, calculated by \((N - 1) \times T\).

## sample
5
5 4 3 2 1
2
8