Robbie the Prankster


Submit solution

Points: 7 (partial)
Time limit: 1.0s
Memory limit: 256M

Author:
Problem type

It's April Fools and Robbie the Ram wants to prank the \(N\) different clubs at St. Robs, each of which have \(S\) members! However, if he pranks two clubs in adjacent rooms, the noise from one will alert the other. Unfortunately, Robbie skipped his latest ICS3U course to rank up in VALORANT. Can you help him determine how he can prank the most number of people?

Constraints

\(1 \leq N \leq 100\)
\(0 \leq S \leq 400\)

Input Specification

An integer \(N\), then \(N\) lines of input representing the number of people \(S\) in the \(N\)th room

Output Specification

A single integer representing the highest number of people he can prank.

Sample Input 1

3
1
2
4

Sample Output 1

5

Comments

There are no comments at the moment.