#Lutece2150. 拍照
拍照
Migrated from Lutece 2150 拍照
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
银杏季的UESTC总能吸引大批游客前来赏景。银杏大道上自北向南有棵银杏,分别有美丽值 。想要拍一张银杏照片,其中有若干棵连续排列的银杏树。由于角度限制,最多将棵银杏拍入一张照片内。
请你帮助计算出一张照片内银杏树美丽值之和的最大值。
Input
第1行两个正整数,表示银杏树有棵,一张照片中最多棵银杏树。
第2行n个整数,表示自北向南有棵银杏的美丽值。
Output
一个整数 , 表示一张照片内银杏树美丽值之和的最大值。
Samples
5 2
1 -2 9 -3 5
9
5 2
-1 -2 -9 -3 -5
-1
Constraints
Resources
2019 UESTC ACM Training for Data Structures