343. Elevator Travel
EasySimulation
An elevator starts at floor 0 and visits the requested floors in the given order. Moving one floor takes 3 seconds and each stop takes 5 seconds. Print the total time.
Input format
Line 1: n Line 2: n floors
Output format
The total seconds.
Example 1
Input
3 5 2 8
Output
57
Example 2
Input
1 0
Output
5
Constraints
1 ≤ n ≤ 10⁵
Read input from standard input and print the answer to standard output. Your code is judged against 3 test cases, most of them hidden.
Loading the MyLoginn IDE…