Write a program that, given and a sequence of
length , finds the sum
of a series of the form
For example, if , , and
, then the
sum would be .
Input
The first line contains an integer , where . The second
line contains , the
length of the sequence , where . Then lines follow, the -th of which contains one integer,
, where .
Output
Output consists of one line with one integer, the sum of the
series.
Sample Input 1 |
Sample Output 1 |
2
4
5
3
6
1
|
106
|
Sample Input 2 |
Sample Output 2 |
1
5
0
5
1231
8
4
|
5
|
Sample Input 3 |
Sample Output 3 |
10
4
0
1
2
3
|
1111
|
Sample Input 4 |
Sample Output 4 |
-5
5
2
4
6
8
10
|
10172525
|
Sample Input 5 |
Sample Output 5 |
-5
5
1
3
5
7
9
|
-2034505
|