func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(0);     cin.tie(0);     int n, k;     cin >> n >> k;     int answer = 0;     int f[n];     for (int i = 0; i < n; i++) cin >> f[i];     sort(f, f + n);     for (int i = n - 1; i >= 0; i -= k) answer += (2 * (f[i] - 1));     cout << answer << endl;     return 0;   }   