Logo
(追記) (追記ここまで)

19355번 - A Really Odd Sequence 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
6 초 512 MB119504145.556%

문제

According to our long-established tradition, the best statements are those kept short.

Given a sequence of integers, find the largest sum of a consecutive subsequence of odd length.

입력

The first line of input contains the number of test cases $z$. The descriptions of the test cases follow.

The first line of each test case contains the length of the sequence $n$ (1ドル \leq n \leq 1,000円,000円$).

The next line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($-10^9 \leq a_i \leq 10^9$), the elements of the sequence.

The total length of all sequences in all test cases does not exceed 5ドル,000円,000円$.

출력

For each test case, output the largest sum on a separate line.

제한

예제 입력 1

1
4
8 -7 9 1

예제 출력 1

10

힌트

출처

Camp > Petrozavodsk Programming Camp > Winter 2017 > Day 1: Jagiellonian U Contest I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /