Language: C++

#include<stdio.h>
#include<algorithm>
int*t,p="%d\n",n,m,d,i,s[99999];main(){for(;scanf("%d%d%d",&d,&n,&m),s[i=n]=d;printf(p,i)){for(;--i;)scanf(p,s+i);for(std::sort(s,s+n);m--;i+=std::min(*t-d,d-t[-1]))scanf(p,&d),t=std::upper_bound(s,s+n,d);}}

Compiler output:
a.cc:3:9: error: invalid conversion from 'const char*' to 'int' [-fpermissive]
    3 | int*t,p="%d\n",n,m,d,i,s[99999];main(){for(;scanf("%d%d%d",&d,&n,&m),s[i=n]=d;printf(p,i)){for(;--i;)scanf(p,s+i);for(std::sort(s,s+n);m--;i+=std::min(*t-d,d-t[-1]))scanf(p,&d),t=std::upper_bound(s,s+n,d);}}
      |         ^~~~~~
      |         |
      |         const char*
a.cc:3:33: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | int*t,p="%d\n",n,m,d,i,s[99999];main(){for(;scanf("%d%d%d",&d,&n,&m),s[i=n]=d;printf(p,i)){for(;--i;)scanf(p,s+i);for(std::sort(s,s+n);m--;i+=std::min(*t-d,d-t[-1]))scanf(p,&d),t=std::upper_bound(s,s+n,d);}}
      |                                 ^~~~
a.cc: In function 'int main()':
a.cc:3:86: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    3 | int*t,p="%d\n",n,m,d,i,s[99999];main(){for(;scanf("%d%d%d",&d,&n,&m),s[i=n]=d;printf(p,i)){for(;--i;)scanf(p,s+i);for(std::sort(s,s+n);m--;i+=std::min(*t-d,d-t[-1]))scanf(p,&d),t=std::upper_bound(s,s+n,d);}}
      |                                                                                      ^
      |                                                                                      |
      |                                                                                      int
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:3:108: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    3 | int*t,p="%d\n",n,m,d,i,s[99999];main(){for(;scanf("%d%d%d",&d,&n,&m),s[i=n]=d;printf(p,i)){for(;--i;)scanf(p,s+i);for(std::sort(s,s+n);m--;i+=std::min(*t-d,d-t[-1]))scanf(p,&d),t=std::upper_bound(s,s+n,d);}}
      |                                                                                                            ^
      |                                                                                                            |
      |                                                                                                            int
/usr/include/stdio.h:428:42: note:   initializing argument 1 of 'int scanf(const char*, ...)'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
a.cc:3:172: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
    3 | int*t,p="%d\n",n,m,d,i,s[99999];main(){for(;scanf("%d%d%d",&d,&n,&m),s[i=n]=d;printf(p,i)){for(;--i;)scanf(p,s+i);for(std::sort(s,s+n);m--;i+=std::min(*t-d,d-t[-1]))scanf(p,&d),t=std::upper_bound(s,s+n,d);}}
      |                                                                                                                                                                            ^
      |                                                                                                                                                                            |
      |                                                                                                                                                                            int
/usr/include/stdio.h:428:42: note:   initializing argument 1 of 'int scanf(const char*, ...)'
  428 | extern int scanf (const char *__restrict __format, ...) __wur;
      |                   ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~