#Lutece2152. 种海带

种海带

Migrated from Lutece 2152 种海带

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

  • 美国核潜艇来不了黄海,因为老百姓在种海带。

相应局座号召,PxtPxt打算研究海带种植。初步研究过供海带种植的海域后,PxtPxt将海域分为了环形的nn块,顺时针编号11nn。并且每块海域都有一个预期收益AiA_i,如果在这里种海带预期可以得到AiA_i的收益。PxtPxt发现如果一个种植方案里,任意两片相邻海域不同时种海带,则花费相同成本种植收益更高而且防御核潜艇的面积更大(ii号位置和i+1i+1号位置叫相邻位置。11号和nn号也是相邻位置)。

PxtPxt打算在mm块区域种海带,请你帮忙设计方案满足以上条件并使得收益总和最大。如果无法将mm片海域种上海带,给出无解信息。

Input

第1行两个正整数n,mn,m

第2行,每行nn个整数AiA_i

Output

一个整数表示最大预期收益。如果无解输出"Error!Error!"

Samples

7 3 
1 2 3 4 5 6 7
15

Constraints

1mn2000001≤m≤n≤200000

1000Ai1000-1000≤ A_i ≤1000

Note

样例解释:选3,5,7,满足选择m块区域不相邻区域且收益最大

Resources

2019 UESTC ACM Training for Data Structures