Atcoder C - Vacation ( DP )
C - Vacation
Time Limit: 2 sec / Memory Limit: 1024 MB
Score : 100100 points
Problem Statement
Taro's summer vacation starts tomorrow, and he has decided to make plans for it now.
The vacation consists of NN days. For each ii (
- A: Swim in the sea. Gain aiai points of happiness.
- B: Catch bugs in the mountains. Gain bibi points of happiness.
- C: Do homework at home. Gain cici points of happiness.
As Taro gets bored easily, he cannot do the same activities for two or more consecutive days.
Find the maximum possible total points of happiness that Taro gains.
Constraints
- All values in input are integers.
- 1≤N≤1051≤N≤105
-