Problem Description

Read n integers (can be negative). Compute maximum subarray sum in circular array and output it.

Input Format

First line n. Second line n integers.

Output Format

One integer maxSum.

Sample Test Case

Input:
4 5 -3 5 2
Output:
12

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next