您的位置:首页 > 其它

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

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

ECJTU_ACM 11级队员2012年暑假训练赛(8)

4:30:00

Overview

Problem

Status

Rank

Discuss

A B C D E F G H I J K

K - A short problem
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status Practice FZU 2013

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:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: