P21490 [HackerEarth] The war is going on between star world and dark world. The king of the starworld need to choose troops of soldiers and send them for war. There are two type of soldiers 1 and 0. He can c
普及
题目描述

The war is going on between star world and dark world. The king of the starworld need to choose troops of soldiers and send them for war. There are two type of soldiers 1 and 0. He can choose atmost k troops and in each troop he can choose consecutive s soldiers from the soldiers who are standing in a row.

Now the problem is soldier of 1 type is more powerful than 0. so he wanted to maximize no. of soldiers having type 1.

Help him to find maximum number of soldiers having type 1.

Input :
first line contains T- no. of test cases.
In each test case first line contains three space separated integers n , k ans s - no. of soldiers , no. of troops , consecutive soldiers in each troop.
Third line contains n space separated integers indicating type of soldier 0 or 1.

Output :
Print maximum number of soldiers of 1 type he is able to choose.

Constraints :
1≤ T ,s ,n, k ≤10^3
1≤ sum of n/s over all test cases ≤10^4

SAMPLE INPUT
5
5 2 2
1 1 1 1 1
6 2 2
1 0 1 0 1 1
6 2 2
1 0 0 0 1 1
7 1 4
1 0 0 0 1 1 1
7 2 4
1 0 0 0 1 1 1

SAMPLE OUTPUT
4
3
3
3
3

输入格式

见题面

输出格式

见题面

样例输入
7 2 1 1 1 1 2 2 1 1 1 2 3 1 1 1 2 4 1 1 1 2 1 2 1 1 2 1 3 1 1 2 1 4 1 1
样例输出
243 141 21 270 499 7 485 316 443 426 77 176 222 199 79 83 35 159 376 442 469 101 256 73 500 240 416 218 277 230 358 341 456 0 412 166 148 0 14 86 465 63 43 218 32 150 217 381 7 430 201 164 460 220 325 205 477 83 47 405 397 481 79 226 82 35 0 182 74 207 113 469 394 246 460 472 364 403 333 432 424 173 451 32 371 432 140 287 78 174 199 490 314 74 208 297 412 20 368 280 320 326 60 242 485 364 411 30 66 238 57 187 443 290 240 287 236 112 209 504 87 136 383 112 82 237 190 470 310 0 96 221 481 306 97 425 14 320 90 334 317 0 415 349 293 339 488 474 111 396 163 9 139 401 308 290 282 172 459 44 495 114 423 13 136 322 0 15 102 485 168 179 23 265 128 504 211 136 471 100 16 236 23 173 397 460 98 62 23 258 253 293 506 151 412 362 233 301 341 293