House Robber Problem
Given house values arranged in a circle, maximize loot without robbing two adjacent houses.
Input format
The first line contains N. The second line contains N amounts (houses in a CIRCLE, 0–100).
Output format
Print maximum loot without robbing adjacent houses.
Constraints
- Values fit in a 64-bit signed integer
- Trailing whitespace and a trailing newline are ignored by the judge
Read from stdin, write to stdout. Sample cases below show the exact format.
Sample cases
Example 1
Input
4
1 2 3 1Expected output
4Example 2
Input
3
2 3 2Expected output
3