Language: C

        int n,m,i,j,min,tmp,jj;

        scanf("%d%d",&n,&m);

        int a[n],b[n],c[m],d[m];

        for(i=0;i<n;i++)
                scanf("%d%d",&a[i],&b[i]);
        for(i=0;i<m;i++)
                scanf("%d%d",&c[i],&d[i]);

        for(i=0;i<n;i++){
                tmp = 10000000;
                for(j=0;j<m;j++){
                        if(c[j]>a[i])
                                min = c[j] - a[i];
                        else
                                min = a[i] -c[j];
                        if(d[j]>b[i])
                                min +=d[j] - b[i];
                        else
                                min +=b[i] - d[j];
                        if(tmp>min){
                                tmp = min;
                                jj = j+1;
                        }
                }
                printf("%d\n",jj);
        }

        return 0;
}


Compiler output:
main.c:3:15: error: expected declaration specifiers or '...' before string constant
    3 |         scanf("%d%d",&n,&m);
      |               ^~~~~~
main.c:3:22: error: expected declaration specifiers or '...' before '&' token
    3 |         scanf("%d%d",&n,&m);
      |                      ^
main.c:3:25: error: expected declaration specifiers or '...' before '&' token
    3 |         scanf("%d%d",&n,&m);
      |                         ^
main.c:5:13: error: variably modified 'a' at file scope
    5 |         int a[n],b[n],c[m],d[m];
      |             ^
main.c:5:18: error: variably modified 'b' at file scope
    5 |         int a[n],b[n],c[m],d[m];
      |                  ^
main.c:5:23: error: variably modified 'c' at file scope
    5 |         int a[n],b[n],c[m],d[m];
      |                       ^
main.c:5:28: error: variably modified 'd' at file scope
    5 |         int a[n],b[n],c[m],d[m];
      |                            ^
main.c:7:9: error: expected identifier or '(' before 'for'
    7 |         for(i=0;i<n;i++)
      |         ^~~
main.c:7:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 |         for(i=0;i<n;i++)
      |                  ^
main.c:7:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    7 |         for(i=0;i<n;i++)
      |                      ^~
main.c:9:9: error: expected identifier or '(' before 'for'
    9 |         for(i=0;i<m;i++)
      |         ^~~
main.c:9:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    9 |         for(i=0;i<m;i++)
      |                  ^
main.c:9:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    9 |         for(i=0;i<m;i++)
      |                      ^~
main.c:12:9: error: expected identifier or '(' before 'for'
   12 |         for(i=0;i<n;i++){
      |         ^~~
main.c:12:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   12 |         for(i=0;i<n;i++){
      |                  ^
main.c:12:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   12 |         for(i=0;i<n;i++){
      |                      ^~
main.c:31:9: error: expected identifier or '(' before 'return'
   31 |         return 0;
      |         ^~~~~~
main.c:32:1: error: expected identifier or '(' before '}' token
   32 | }
      | ^