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: #include <bits/stdc++.h>
using namespace std;
int m = 100001;
int main(){
int n,k;
cin>>n>>k;
long long a[n],sum=0;
for(int i=0;i<n;i++){
    cin>>a[i];
    if(a[i]<0){
        a[i]=-a[i];
    }
}
sort(a,a+n);
for(int i=0;i<k;i++){
    sum+=a[n-i-1]*a[n-i-1];
}
cout<<sum;

}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?