For this Question: There are <b>N</b> COVID centres on the X- axis. Their positions are <b>X<sub>1</sub>, X<sub>2</sub>,... , X<sub>N</sub></b>. You are standing at the origin O (x = 0) with N sick people. You have to drive each of these to one of the N covid centres such that no two people reach the same centre and each centre receives exactly one patient. 

You can use your car to take these people to the hospital but your car can carry only <b>K</b> patients at a time. Find the minimum distance you will have to drive in order to accomplish this task.
<b> Note: After driving all the N people to their respective COVID centres, you do not have to go back to the origin. </b>The first line contains two integers N, the number of centres and people and K, the capacity of your car.
The second line contains N integers X<sub>1</sub>, X<sub>2</sub>,... , X<sub>N</sub>. <b>It is possible that more than one COVID centres lie on the same point. </b>

Constraints:
1 <= K <= N <= 10<sup>5</sup>
-10<sup>9</sup> <= X<sub>i</sub> <= 10<sup>9</sup>Print the minimum distance you will have to drive in order to deliver the N patients to the N covid centres.Sample Input:
5 1
1 2 3 4 5

Sample Output:
25

Sample Input:
5 3
3 3 4 4 4

Sample Output:
10

Explanation Sample1:
You can drive only 1 patient at a time in your car, so here is how you can go:-
0 -> 1 -> 0 -> 2 -> 0 -> 3 -> 0 -> 4 -> 0 -> 5
You drive one by one to the four centres at x = 1, 2, 3, 4. and then you drive the 5<sup>th</sup> patient to the last centre at x = 5 and stop there.
So, the total distance becomes 2 * (1 + 2 + 3 + 4) + 5 = 25
It can be proved that their exists no shorter way of doing so., I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
    public static long negativeIndexes(int covidCentres[], int negativeIndex, int n, int k){
        long totalDistance = 0;
        if(negativeIndex >= 0){
            negativeIndex -= (negativeIndex) % k;

            while(negativeIndex >= 0){
                totalDistance += 2*(Math.abs(covidCentres[negativeIndex]));
                negativeIndex -= k;
            }
        }
        return totalDistance;
    }
    public static long positiveIndexes(int covidCentres[], int positiveIndex, int n, int k){
        long totalDistance = 0;
        if(positiveIndex <= n-1){
            positiveIndex += (n-1 - positiveIndex) % k;

            while(positiveIndex <= n-1){
                totalDistance += 2*covidCentres[positiveIndex];
                positiveIndex += k;
            }
        }
        return totalDistance;
    }
    public static void main (String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line[] = br.readLine().strip().split(" ");
        int n = Integer.parseInt(line[0]);
        int k = Integer.parseInt(line[1]);

        long totalDistance = 0;

        int covidCentres[] = new int[n];

        line = br.readLine().strip().split(" ");
        for(int i=0; i<n; i++){
            covidCentres[i] = Integer.parseInt(line[i]);
        }

        Arrays.sort(covidCentres);

        int positiveIndex = 0;
        int negativeIndex;

        for(int i=0; i<n; i++){
            if(covidCentres[i] < 0){
                positiveIndex++;
            }else{
                break;
            }
        }

        negativeIndex = positiveIndex - 1;
        if(Math.abs(covidCentres[0]) < Math.abs(covidCentres[n-1])){
            totalDistance += negativeIndexes(covidCentres, negativeIndex, n, k);
            totalDistance += positiveIndexes(covidCentres, positiveIndex, n, k);

            totalDistance -=  Math.abs(covidCentres[n-1]);
        }else{
            totalDistance += positiveIndexes(covidCentres, positiveIndex, n, k);
            totalDistance += negativeIndexes(covidCentres, negativeIndex, n, k);

            totalDistance -=  Math.abs(covidCentres[0]);
        }

        System.out.println(totalDistance);
    }
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?