For this Question: Given an array A of size n, and an integer k. Find the maximum force by involving only k elements. The Force of an element is the square of its value.

<b>Note:</b> 
Elements are not needed to be continuous.The first line of the input contains two integers denoting n and k.
The next line contains n integers denoting elements of the array.

<b>Constraints:</b>
1 < = k < = n < = 1000
-10^7 <= A[i] <= 10^7Output the maximum force.Sample Input 1:
4 4
1 2 3 4

Sample Output 1:
30

Sample Input 2:
2 1
1 10

Sample Output 2:
100

<b>Explanation:</b>
Force = 1*1 + 2*2 + 3*3 + 4*4 = 30, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException {

		InputStreamReader ir = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(ir);
		String[] NK = br.readLine().split(" ");
		String[] inputs = br.readLine().split(" ");
		int N = Integer.parseInt(NK[0]);
		int K = Integer.parseInt(NK[1]);
		long[] arr = new long[N];
		long answer = 0;
		for(int i = 0; i < N; i++){
			arr[i] = Math.abs(Long.parseLong(inputs[i]));
		}
		quicksort(arr, 0, N-1);
		for(int i = (N-K); i < N;i++){

			answer += (arr[i]*arr[i]);
		}
		System.out.println(answer);
	}

	static void quicksort(long[] arr, int start, int end){
		if(start < end){
			int pivot = partition(arr, start, end);
			quicksort(arr, start, pivot-1);
			quicksort(arr, pivot+1, end);
		}
	}

	static int partition(long[] arr, int start, int end){
		long pivot = arr[end];
		int i = start - 1;
		for(int j = start; j < end; j++){
			if(arr[j] < pivot){
				i++;
				swap(arr, i, j);
			}
		}
		swap(arr, i+1, end);
		return (i+1);
	}

	static void swap(long[] arr, int i, int j){
		long temp = arr[i];
		arr[i] = arr[j];
		arr[j] = temp;
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?