func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 200010;   set<pair<long long, long long> > st;   int resp[maxn];   struct island {     long long ini, fim;   } isl[maxn];   struct event {     long long type, val, ini;     event() { type = 0, val = 0, ini = 0; }     event(long long a, long long b, long long c) {       type = a;       val = b;       ini = c;     }   } e[2 * maxn];   bool cmp(event a, event b) {     if (a.ini == b.ini && a.type == b.type) return a.val < b.val;     if (a.ini == b.ini) return a.type < b.type;     return a.ini < b.ini;   }   int main() {     int n, m;     scanf( %d %d , &n, &m);     long long al, bl;     int siz = 0;     for (int i = 0; i < n; i++) {       long long a, b;       scanf( %I64d %I64d , &a, &b);       if (i != 0) {         isl[i - 1].fim = b - al;         isl[i - 1].ini = a - bl;         int atual = i - 1;         e[siz++] = event(1, atual, isl[i - 1].ini);       }       al = a;       bl = b;     }     for (int i = 0; i < m; i++) {       long long q;       scanf( %I64d , &q);       e[siz++] = event(2, i, q);     }     sort(e, e + siz, cmp);     for (int i = 0; i < siz; i++) {       if (e[i].type == 1) {         st.insert(make_pair(isl[e[i].val].fim, e[i].val));       } else {         set<pair<long long, long long> >::iterator it =             st.lower_bound(make_pair(e[i].ini, -1LL));         if (it != st.end()) {           resp[it->second] = e[i].val;           st.erase(it);         }       }     }     int ok = 1;     if (!st.empty()) ok = 0;     if (ok) {       puts( Yes );       for (int i = 0; i < n - 1; i++) {         printf( %d  , resp[i] + 1);       }       printf(  n );     } else {       puts( No );     }   }   