【ECJTU_ACM 11级队员2012年暑假训练赛(8) - K - A short problem】

B题要套一个数论的模版,注意m=1!! C题可以二分匹配,把行列看作点; 不能开百度,开谷歌搜题解,再次强调!一经发现,取消成绩!

ECJTU_ACM 11级队员2012年暑假训练赛(8)
4:30:00
K - A short problem
Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u

Description

The description of this problem is very short. Now give you a string(length N), and ask you the max sum of the substring which the length can't small than M.

Input

The first line is one integer T(T≤20) indicates the number of the test cases. Then for every case, the first line is two integer N(1≤N≤1000000) and M(1≤M≤N).

Then one line contains N integer indicate the number. All the number is between -10000 and 10000.

Output

Output one line with an integer.

Sample Input

2
5 1
1 -2 -2 -2 1
5 2
1 -2 -2 -2 1

Sample Output

1
-1

FAQ | About Virtual Judge | Forum | Discuss | Open Source Project
All Copyright Reserved ©2010-2012 HUST ACM/ICPC TEAM 
Anything about the OJ, please ask in the forum, or contact author:Isun
Server Time: 
 
 
posted @ 2012-08-13 10:58  ismdeep  阅读(233)  评论(0编辑  收藏  举报