func_code_string: #include <bits/stdc++.h>   using namespace std;   inline int abs(int x) { return x > 0 ? x : (-x); }   int len[505], rod[505], flag[505], mask[505];   int main() {     int n, m, x, y, x1, y1, i, j, x0, y0;     while (scanf( %d%d , &n, &m) != EOF) {       scanf( %d%d , &x1, &y1);       x0 = x1, y0 = y1;       for (i = 1; i < n; i++) {         scanf( %d%d , &x, &y);         if (x == x1) {           len[i] = abs(y - y1);           y1 = y;         } else {           len[i] = abs(x - x1);           x1 = x;         }       }       if (x == x0)         len[0] = len[n] = abs(y - y0);       else         len[0] = len[n] = abs(x - x0);       for (i = 1; i <= m; i++) scanf( %d , &rod[i]);       if (n & 1) {         printf( NO n );         continue;       }       memset(mask, -1, sizeof(mask));       memset(flag, 0, sizeof(flag));       int cnt = 0;       for (i = 0; i < n; i += 2) {         for (j = 1; j <= m; j++) {           if (!flag[j] && len[i] + len[i + 1] == rod[j]) {             flag[j] = 1;             mask[i] = j;             cnt++;             break;           }         }       }       if (cnt == n / 2) {         printf( YES n );         for (i = 0; i < n - 1; i++) printf( %d  , mask[i]);         printf( %d n , mask[i]);       } else {         cnt = 0;         memset(mask, -1, sizeof(mask));         memset(flag, 0, sizeof(flag));         for (i = 1; i < n; i += 2)           for (j = 1; j <= m; j++)             if (!flag[j] && len[i] + len[i + 1] == rod[j]) {               flag[j] = 1;               mask[i] = j;               cnt++;               break;             }         if (cnt == n / 2) {           printf( YES n );           for (i = 0; i < n - 1; i++) printf( %d  , mask[i]);           printf( %d n , mask[i]);         } else           printf( NO n );       }     }     return 0;   }   