A total of n depots are located on a number line. Depot i lies at the point x_i for 1 ≤ i ≤ n.

You are a salesman with n bags of goods, attempting to deliver one bag to each of the n depots. You and the n bags are initially at the origin 0. You can carry up to k bags at a time. You must collect the required number of goods from the origin, deliver them to the respective depots, and then return to the origin to collect your next batch of goods.

Calculate the minimum distance you need to cover to deliver all the bags of goods to the depots. You do not have to return to the origin after you have delivered all the bags.

Input

Each test contains multiple test cases. The first line contains the number of test cases t (1 ≤ t ≤ 10 500). Description of the test cases follows.

The first line of each test case contains two integers n and k (1 ≤ k ≤ n ≤ 2 ⋅ 10^5).

The second line of each test case contains n integers x_1, x_2, …, x_n (-10^9 ≤ x_i ≤ 10^9). It is possible that some depots share the same position.

It is guaranteed that the sum of n over all test cases does not exceed 2 ⋅ 10^5.

Output

For each test case, output a single integer denoting the minimum distance you need to cover to deliver all the bags of goods to the depots. 

Example

Input


4
5 1
1 2 3 4 5
9 3
-5 -10 -15 6 5 8 3 7 4
5 3
2 2 3 3 3
4 2
1000000000 1000000000 1000000000 1000000000


Output


25
41
7
3000000000

Note

In the first test case, you can carry only one bag at a time. Thus, the following is a solution sequence that gives a minimum travel distance: 0 → 2 → 0 → 4 → 0 → 3 → 0 → 1 → 0 → 5, where each 0 means you go the origin and grab one bag, and each positive integer means you deliver the bag to a depot at this coordinate, giving a total distance of 25 units. It must be noted that there are other sequences that give the same distance.

In the second test case, you can follow the following sequence, among multiple such sequences, to travel minimum distance: 0 → 6 → 8 → 7 → 0 → 5 → 4 → 3 → 0 → (-5) → (-10) → (-15), with distance 41. It can be shown that 41 is the optimal distance for this test case.
	import java.util.*;
	import java.io.*;
	import java.math.*;
	
	    public class Main {
	
	        // -- static variables --- //
	        static FastReader sc = new FastReader();
	        static PrintWriter out = new PrintWriter(System.out);
	        static int mod = (int) 1000000007;
	        public static void main(String[] args) throws Exception {
	         
	            int t=sc.nextInt();
	            while(t-->0)
	            Main.go();
	//             out.println();
	            out.flush();
	        }
	
	        // >>>>>>>>>>>>>>>>>>> Code Starts <<<<<<<<<<<<<<<<<<<< //
	        static class pair{
	            int  x;int y;
	            pair(int  x,int y){
	                this.x=x;
	                this.y=y;
	            }
							@Override
							public int hashCode() {
								final int prime = 31;
								int result = 1;
								result = prime * result + x;
								result = prime * result + y;
								return result;
							}
							@Override
							public boolean equals(Object obj) {
								if (this == obj)
									return true;
								if (obj == null)
									return false;
								if (getClass() != obj.getClass())
									return false;
								pair other = (pair) obj;
								if (x != other.x)
									return false;
								if (y != other.y)
									return false;
								return true;
							}
	            
	        }


	        static void go() throws Exception {
	        		int n=sc.nextInt();
	        		int k=sc.nextInt();
	        		int a[]=sc.intArray(n);
	        		sort(a);
	        		ArrayList<Integer> negative=new ArrayList<>();
	        		ArrayList<Integer> positive=new ArrayList<>();
	        		int max1=Integer.MIN_VALUE;
	        		int max2=Integer.MIN_VALUE;
	        		for(int i=0;i<n;i++) {
	        			if(a[i]>0) {
	        			positive.add(a[i]);
	        			max1=Math.max(max1,a[i]);
	        		}else if(a[i]<=0) {
	        			negative.add(Math.abs(a[i]));
	        			max2=Math.max(max2,-a[i]);
	        		}
	        		}
	   
	        		Collections.sort(negative);
	        		long ans1=0;
	        		long ans2=0;
	        		int l1=positive.size();
	        		int l2=negative.size();
//	        		out.println(positive);
//	        		out.println(negative);
	        		ans1=calculate1(positive,k)*2;
	        		ans2=calculate1(negative,k)*2;
//	        		out.println(ans1+" "+ans2);
	        		if(negative.size()==0) {
	        			out.println(ans1-positive.get(l1-1));
	        		}else if(positive.size()==0) {
	        			out.println(ans2-negative.get(l2-1));
	        		}else if(positive.size()>0 && negative.size()>0) {
	        		if(positive.get(l1-1)>negative.get(l2-1)) {
	        			out.println(ans1+ans2-positive.get(l1-1));
	        		}else {
	        			out.println(ans1+ans2-negative.get(l2-1));
	        		}
	        		}
	        

	        }
	        
	        static long calculate1(ArrayList<Integer> positive,int k) {

	      		long ans=0;
	      		int n=positive.size();
	      		int temp=n;
	      		int i;
	      		for( i=n-1;i>=0;i-=k) {
	      			ans=ans+positive.get(i);
	      		}
//	      		if(i+k<k-1) {
//	      			out.println(positive.get(i+k));
//	      		ans=ans+positive.get(i+k);
//	      		}
	      		
	      		return ans;
	        }
	        static long calculate(ArrayList<Integer> positive,int k) {
	      		int right_index=positive.size();
        		long ans=0;
        		int i=k-1;
//        		out.println(right_index);
        		for( ;i<=Math.min(positive.size()-1,right_index);i+=(k)) {
//        			out.println(positive.get(i));
        			ans=ans+positive.get(i)*2;
        		}
//        		out.println("?"+ans);
        		if(positive.size()-1>=right_index-1 && i-k!=right_index-1) {
        			ans=ans+positive.get(right_index)*2;
        		}
//        		out.println("?"+ans);
        	
        		return ans;
	        }
	        
	        static long lcm(long a,long b) {
	        	return a*b/gcd(a,b);
	        }
	     
	    
	        // >>>>>>>>>>> Code Ends <<<<<<<<< //
	
	        // --For Rounding--//
	        static double round(double value, int places) {
	
	            if (places < 0)
	                throw new IllegalArgumentException();
	            BigDecimal bd = new BigDecimal(Double.toString(value));
	            bd = bd.setScale(places, RoundingMode.HALF_UP);
	            return bd.doubleValue();
	        }
	
	        // ----Greatest Common Divisor-----//
	        static long gcd(long a, long b) {
	            if (b == 0) {
	                return a;
	            }
	            return gcd(b, a % b);
	        }
	
	        // --- permutations and Combinations ---//
	        static long fact[];
	        static long invfact[];
	
	        static long ncr(int n, int k) {
	            if (k < 0 || k > n) {
	                return 0;
	            }
	            long x = fact[n];
	            long y = fact[k];
	            long yy = fact[n - k];
	            long ans = (x / y);
	            ans = (ans / yy);
	            return ans;
	        }
	
	        // ---sieve---//
	        static int prime[] = new int[1000006];
	
	        // static void sieve() {
	        //     Arrays.fill(prime, 1);
	        //     prime[0] = 0;
	        //     prime[1] = 0;
	        //     for (int i = 2; i * i <= 1000005; i++) {
	        //         if (prime[i] == 1)
	        //             for (int j = i * i; j <= 1000005; j += i) {
	        //                 prime[j] = 0;
	        //             }
	        //     }
	        // }
	
	        // ---- Manual sort ------//
	        static void sort(long[] a) {
	            ArrayList<Long> aa = new ArrayList<>();
	            for (long i : a) {
	                aa.add(i);
	            }
	            Collections.sort(aa);
	            for (int i = 0; i < a.length; i++)
	                a[i] = aa.get(i);
	        }
	
	        static void sort(int[] a) {
	            ArrayList<Integer> aa = new ArrayList<>();
	            for (int i : a) {
	                aa.add(i);
	            }
	            Collections.sort(aa);
	            for (int i = 0; i < a.length; i++)
	                a[i] = aa.get(i);
	        }
	
	        // --- Fast exponentiation ---//
	        static long pow(long x, long y) {
	            long res = 1l;
	            while (y != 0) {
	                if (y % 2 == 1) {
	                    res = (x * res)%mod;
	                }
	                y /= 2;
	                x = (x * x)%mod;
	            }
	            return res;
	        }
	
	        // >>>>>>>>>>>>>>> Fast IO <<<<<<<<<<<<<< //
	        static class FastReader {
	            BufferedReader br;
	            StringTokenizer st;
	
	            public FastReader() {
	                br = new BufferedReader(new InputStreamReader(System.in));
	            }
	
	            String next() {
	                while (st == null || !st.hasMoreElements()) {
	                    try {
	                        st = new StringTokenizer(br.readLine());
	                    } catch (IOException e) {
	                        e.printStackTrace();
	                    }
	                }
	                return st.nextToken();
	            }
	
	            int nextInt() {
	                return Integer.parseInt(next());
	            }
	
	            long nextLong() {
	                return Long.parseLong(next());
	            }
	
	            double nextDouble() {
	                return Double.parseDouble(next());
	            }
	
	            int[] intArray(int n) {
	                int a[] = new int[n];
	                for (int i = 0; i < n; i++)
	                    a[i] = sc.nextInt();
	                return a;
	            }
	
	            long[] longArray(int n) {
	                long a[] = new long[n];
	                for (int i = 0; i < n; i++)
	                    a[i] = sc.nextLong();
	                return a;
	            }
	
	            String nextLine() {
	                String str = "";
	                try {
	                    str = br.readLine();
	                } catch (IOException e) {
	                    e.printStackTrace();
	                }
	                return str;
	            }
	        }
	    }