func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     long long n, k;     cin >> n >> k;     vector<long long> a(n);     for (size_t i = 0; i < n; i++) {       cin >> a[i];     }     long long ans = a[n - 1] - a[0];     multiset<long long> s;     for (long long i = 1; i < n; i++) {       s.insert(a[i - 1] - a[i]);     }     for (auto i : s) {       if (k == 1) {         cout << ans;         return 0;       } else {         k--;         ans += i;       }     }     cout << ans;     return 0;   }   