func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = 0x3f3f3f3f;   const long long LINF = 0x3f3f3f3f3f3f3f3f;   const int MAXA = 2e5 + 10;   const int MAX = 2e3 + 10;   int n, m, k;   int a[MAXA];   int M = 0;   pair<int, int> p[MAX];   long long sum[MAX];   long long memo[MAX];   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cin >> n >> m >> k;     for (int i = 0; i < n; i++) cin >> a[i];     vector<int> f(MAX, -1);     for (int i = 0; i < m; i++) {       int x, y;       cin >> x >> y;       if (x > MAX) continue;       f[x] = max(f[x], y);     }     for (int i = 1; i < MAX; i++) {       if (f[i] == -1) continue;       p[M++] = {i, f[i]};     }     partial_sort(&a[0], &a[min(n, MAX)], &a[n]);     sum[0] = 0;     for (int i = 0; i < k; i++) {       sum[i + 1] = sum[i] + a[i];     }     memo[k] = 0;     for (int i = k - 1; i >= 0; i--) {       long long ans = a[i] + memo[i + 1];       for (int j = 0; j < M; j++) {         if (i + p[j].first > k) break;         long long r = memo[i + p[j].first];         ans = min(ans, sum[i + p[j].first] - sum[i + p[j].second] + r);       }       memo[i] = ans;     }     cout << memo[0] <<   n ;     exit(0);   }   