func_code_string: #include <bits/stdc++.h>   using namespace std;   template <class T>   void read(T &x) {     int f = 0;     x = 0;     char ch = getchar();     for (; !isdigit(ch); ch = getchar()) f |= (ch ==  - );     for (; isdigit(ch); ch = getchar()) x = x * 10 + ch -  0 ;     if (f) x = -x;   }   const int N = 200005;   int a[N], b[N], c[N], ans[N], n, m, cnt, s;   pair<pair<int, int>, int> x[N];   int check(int lim) {     priority_queue<pair<int, int>, vector<pair<int, int> >,                    greater<pair<int, int> > >         Q;     int cost = 0, rem = 0, id = 0;     for (int i = (cnt); i >= (1); i--) {       if (x[i].second == 0) {         if (!rem) {           if (Q.empty()) return 0;           rem = lim, cost += Q.top().first, id = Q.top().second, Q.pop();           if (cost > s) return 0;         }         rem--, ans[-x[i].first.second] = id;       } else {         Q.push(make_pair(x[i].first.second, x[i].second));       }     }     return 1;   }   int main() {     read(n), read(m), read(s);     for (int i = (1); i <= (m); i++) {       read(a[i]);       x[++cnt] = make_pair(make_pair(a[i], -i), 0);     }     for (int i = (1); i <= (n); i++) {       read(b[i]);     }     for (int i = (1); i <= (n); i++) {       read(c[i]);       x[++cnt] = make_pair(make_pair(b[i], c[i]), i);     }     sort(x + 1, x + cnt + 1);     int l = 1, r = m + 1;     while (l < r) {       int mid = (l + r) >> 1;       if (check(mid))         r = mid;       else         l = mid + 1;     }     if (l == m + 1)       puts( NO );     else {       puts( YES );       check(l);       for (int i = (1); i <= (m); i++) {         printf( %d%c , ans[i],    n [i == m]);       }     }     return 0;   }   