#Lutece0571. Electric System Restore

Electric System Restore

Migrated from Lutece 571 Electric System Restore

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

After building and improving the traffic system of Country X, Qiqi wants to restore the electric system. Every City in Country X can be supplied by the base station or itself. The cost of transportation between base station and a city is the distance between them, i.e. if their coordinates are (x1,y1)(x_1, y_1) and (x2,y2)(x_2, y_2), their distance equals to x1x2+y1y2|x_1 - x_2| + |y_1 - y_2|. Also, it costs CiC_i to power itself for the ithi_{th} city.

Due to some reasons, the number of cities powering themselves should be no more than KK. As the chief designer of Country X, it's your job to place the base station and assign the cities powering themselves to minimize the total cost. Note that you can place the base station at any integer point.

Input

There are multiple test cases. The first line of the input will be an integer TT (T20T \leq 20) indicating the number of test cases.

For each test case there are two integers NN and KK (1N10001 \leq N \leq 1000, 0K200 \leq K \leq 20, KNK \leq N) in a single line, representing the number of cities in Country X and Qiqi allows at most KK cities power itself. The next line lists NN integers, CiC_i, describing the cost of power itself of each city. Then NN lines follow, each contains two integers XiX_i and YiY_i, indicating the coordinate of the ithi_{th} city. 0Xi,Yi,Ci1060 \leq X_i, Y_i, C_i \leq 10^6 for 1iN1 \leq i \leq N.

Output

For each test case, print Case #t: first, in which tt is the number of the test case starting from 11. Then output the minimum costs.

Samples

1
4 1
2 2 2 2
1 1
1 2
2 1
2 3
Case #1: 4

Note

For the first sample, we should build the base station at (1,1)(1,1) and make the 4th4_{th} city power itself.

Resources

10th UESTC Programming Contest Final