Gửi bài giải
Điểm:
1,00 (OI)
Giới hạn thời gian:
1.0s
Giới hạn bộ nhớ:
256M
Input:
stdin
Output:
stdout
Nguồn bài:
Dạng bài
Ngôn ngữ cho phép
C, C++, Java, Kotlin, Pascal, PyPy, Python, Scratch
Dat is a mischievous kid and often throws all of the toys in the box out. Dat's brother Tu always had to clean every day, getting bored, so today he doesn't clean in the usual way anymore.
Tu wanted to know that if only one toy was brought back to the box each time, how many steps would Tu need to take all the toys knowing that Tu was standing next to the box.
Input
The first line is the number N, the number of toys Dat has thrown.(1 <= N <= ~10^{6}~)
Line 2 contains N non-negative integers that are not exceed ~10^{6}~, is the number of steps from the toy box to the thrown items.
Output
The total number of steps Tu needs to take.
Sample Input:
3
4 8 10
Sample Output:
44
Bình luận