For this Question: You are given an array A of size N. You can apply the following operation at most M times:
<ul>
<li>Select two indices i, j such that (1 <= i < j <= N) and i % M == j % M</li>
<li>Swap A<sub>i</sub> and A<sub>j</sub>.
</ul>
After performing all these operations, you have to choose any subarray of size M from this array. And the sum of all elements in this subarray is your strength. Find the maximum strength you can obtain.The first line of the input contains two integers N and K.
The second line of the input contains N space seperated integers.

Constraints:
1 <= K <= N <= 10<sup>5</sup>
1 <= A<sub>i</sub> <= 10<sup>9</sup>Print the maximum strength you can get.Sample Input:
5 2
6 4 8 2 3

Sample Output:
12

Explaination:
We simply take the subarray l = 2, r = 3. Sum = 12
This is the maximum possible., I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;
#define int long long

signed main(){
    int n, k;
    cin >> n >> k;
    vector<vector<int>> v(k);
    for(int i = 0; i < n; i++){
        int m;
        cin >> m;
        int rem = (i+1)%k;
        v[rem].push_back(m);
    }
    for(int i = 0; i < k; i++){
        sort(v[i].rbegin(), v[i].rend());
    }
    int ans=0;
    for(int i = 0; i < k; i++) {
        ans += v[i][0];
    }
    cout << ans;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?