A. 后半段求和 / Second Half Sum

    传统题 1000ms 256MiB

后半段求和 / Second Half Sum

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

Problem Statement

You are given an integer sequence of length NN: A=(A1,A2,…,AN)A=(A_1,A_2,\dots,A_N). Here, NN is even. Find the sum of the latter half of AA, that is, the sum of A(N/2)+1,A(N/2)+2,…,ANA_{(N/2)+1},A_{(N/2)+2},\dots,A_{N}.

Constraints

  • All input values are integers.
  • NN is an even number satisfying 2≤N≤1002 \le N \le 100.
  • 1≤Ai≤1001 \le A_i \le 100

Input

The input is given from Standard Input in the following format:

  • NN
  • A1A_1 A2A_2 …\dots ANA_N

Output

Output the answer.

8
1 3 7 8 4 2 5 6
17

The length of the sequence AA is N=8N=8, and you should find the sum of A5,A6,A7,A8A_5,A_6,A_7,A_8. Since A5+A6+A7+A8=4+2+5+6=17A_5+A_6+A_7+A_8 = 4+2+5+6=17, output 1717.

2
1 100
100
10
31 41 59 26 53 58 97 93 23 84
355

ABC473 赛后模拟赛 ✅

未参加
状态
已结束
规则
IOI
题目
7
开始于
2026-8-29 21:40
结束于
2026-9-12 21:40
持续时间
336 小时
主持人
参赛人数
45