func_code_string: #include <bits/stdc++.h>   using namespace std;   struct nod {     int x, y;   } num[110000];   struct nod2 {     int qian, zhi;   } bian[110000];   struct nod3 {     int ls, rs, l, r, mi;   } t[410000];   int n, p, a, b, mi, i, x[110000], wei[410000], use[110000], use2[110000],       w[110000];   int build(int l, int r) {     int mid, k;     k = ++p;     mid = (l + r) / 2;     t[k].mi = 10000000;     t[k].l = l;     t[k].r = r;     if (l == r) return (k);     t[k].ls = build(l, mid);     t[k].rs = build(mid + 1, r);     return (k);   }   bool cmp(nod a, nod b) {     if (a.x != b.x) return (a.x > b.x);     return (a.y > b.y);   }   void build2(int d, int a) {     p++;     bian[p].qian = wei[d];     bian[p].zhi = a;     wei[d] = p;   }   int qiu(int d, int l, int r) {     int mid;     if (l <= t[d].l && r >= t[d].r) return (t[d].mi);     mid = (t[d].l + t[d].r) / 2;     if (l > mid) return (qiu(t[d].rs, l, r));     if (r <= mid) return (qiu(t[d].ls, l, r));     return (min(qiu(t[d].ls, l, mid), qiu(t[d].rs, mid + 1, r)));   }   void jia(int d, int a, int b) {     int mid;     if (t[d].l == t[d].r) {       t[d].mi = min(t[d].mi, b);       return;     }     mid = (t[d].l + t[d].r) / 2;     if (a <= mid) jia(t[d].ls, a, b);     if (a > mid) jia(t[d].rs, a, b);     t[d].mi = min(t[t[d].ls].mi, t[t[d].rs].mi);   }   int main() {     scanf( %d , &n);     for (i = 1; i <= n; i++) {       scanf( %d%d , &num[i].x, &num[i].y);       use[i] = num[i].y - num[i].x;     }     for (i = 1; i <= n; i++) {       scanf( %d , &w[i]);       use2[i] = w[i];     }     sort(use + 1, use + 1 + n);     sort(use2 + 1, use2 + 1 + n);     for (i = 1; i <= n; i++)       if (use[i] != use2[i]) {         printf( No n );         return (0);       }     build(0, 100000);     p = 0;     for (i = 1; i <= n; i++) build2(w[i] + 110000, i);     sort(num + 1, num + 1 + n, cmp);     for (i = 1; i <= n; i++) {       a = 110000 + num[i].y - num[i].x;       b = wei[a];       mi = qiu(1, num[i].y, 100000);       if (bian[b].zhi > mi) {         printf( No n );         return (0);       }       jia(1, num[i].y, bian[b].zhi);       x[bian[b].zhi] = i;       wei[a] = bian[b].qian;     }     printf( Yes n );     for (i = 1; i <= n; i++) printf( %d %d n , num[x[i]].x, num[x[i]].y);   }   