CF1978A Alice and Books

题目描述

### 题意翻译 Alice有n本书,第一本书有 $a_1$页,序号为1,第二本书有$a_2$页,序号为2, …… , 第n本书有$a_n$页,序号为n。Alice将把所有书分成两堆,并阅读每一堆中序号最大的一本书。 Alice喜欢读书,请你告诉她,她最多可以读多少页的书。

输入格式

一个正整数t($ 1 \le t\le500$),表示数据组数。 每组数据的第一行一个正整数n($2 \le n \le 100$),表示书本的数量. 每组数据的第二行包含n个数,$a_1,a_2,...,a_n$,表示每本书的页数。

输出格式

对于每组数据,输出一个正整数,表示Alice可以阅读的最大页数。

说明/提示

In the first test case, Alice can put book number $ 1 $ in the first pile, and book number $ 2 $ in the second pile. Then she will read $ a_1 + a_2 = 1 + 1 = 2 $ pages. In the second test case, Alice can put books with numbers $ 2 $ and $ 3 $ in the first pile, and books with numbers $ 1 $ and $ 4 $ in the second pile. Then she will read the book with the highest number $ 3 $ from the first pile, and the book with the highest number $ 4 $ from the second pile. Then she will read $ a_3 + a_4 = 3 + 1 = 4 $ pages.