/
Time Limit: 2 sec / Memory Limit: 1024 MiB
配点 : 100 点
問題文
長さ N の整数列 A=(A_1,A_2,\dots,A_N) が与えられます。ここで、 N は偶数です。
A の後半部分の総和、つまり、 A_{(N/2)+1},A_{(N/2)+2},\dots,A_{N} の総和を求めてください。
制約
- 入力は全て整数
- N は 2 \le N \le 100 を満たす偶数
- 1 \le A_i \le 100
入力
入力は以下の形式で標準入力から与えられる。
N A_1 A_2 \dots A_N
出力
答えを出力せよ。
入力例 1
8 1 3 7 8 4 2 5 6
出力例 1
17
数列 A の長さは N=8 であり、求めるべきは A_5,A_6,A_7,A_8 の総和です。
A_5+A_6+A_7+A_8 = 4+2+5+6=17 なので、 17 と出力してください。
入力例 2
2 1 100
出力例 2
100
入力例 3
10 31 41 59 26 53 58 97 93 23 84
出力例 3
355
Score : 100 points
Problem Statement
You are given an integer sequence of length N: A=(A_1,A_2,\dots,A_N). Here, N is even.
Find the sum of the latter half of A, that is, the sum of A_{(N/2)+1},A_{(N/2)+2},\dots,A_{N}.
Constraints
- All input values are integers.
- N is an even number satisfying 2 \le N \le 100.
- 1 \le A_i \le 100
Input
The input is given from Standard Input in the following format:
N A_1 A_2 \dots A_N
Output
Output the answer.
Sample Input 1
8 1 3 7 8 4 2 5 6
Sample Output 1
17
The length of the sequence A is N=8, and you should find the sum of A_5,A_6,A_7,A_8.
Since A_5+A_6+A_7+A_8 = 4+2+5+6=17, output 17.
Sample Input 2
2 1 100
Sample Output 2
100
Sample Input 3
10 31 41 59 26 53 58 97 93 23 84
Sample Output 3
355