#P1897. 电梯里的尴尬

电梯里的尴尬

Description

So, while trying to strike up a conversation with the “da shen,” Xiao W also watches the floor number displayed in the elevator. He notices that going up one floor takes 66 seconds, going down one floor takes 44 seconds, each door opening takes 55 seconds (only if someone arrives and the elevator stops), and each person getting off adds 11 second.

It is specifically stated that the elevator starts on floor 00, and it must return to floor 00 at the end for the trip to be considered finished. Assuming that at the beginning we know the destination floor of every person currently inside the elevator, can you compute the total time needed to complete this trip?

This is a very simple problem. You should know that Xiao W has already trained himself to quickly do the mental arithmetic. Now you try to program it!

Input Format

There are 22 lines.

The first line contains a positive integer nn, the number of people riding the elevator.

The second line contains nn positive integers. aia_{i} denotes the destination floor of the ii-th person.

Output Format

Output one line containing a positive integer — the time needed to complete this trip.

4
2 4 3 2 
59

Hint

For 60%60\% of the testdata, 0<n<1040<n<10^4.

For 100%100\% of the testdata, 0<n<1050<n<10^5, 0<ai2×1070<a_{i}\leq 2\times 10^7.

Translated by ChatGPT 5