Language: C++

using System;
using System.Collections.Generic;
class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = int.Parse(input[0]), b = int.Parse(input[1]), q = int.Parse(input[2]);

            long[] s = new long[a];
            for (int i=0; i<a; i++) s[i] = long.Parse(Console.ReadLine());

            long[] t = new long[b];
            for (int i=0; i<b; i++) t[i] = long.Parse(Console.ReadLine()); 

            for (int i=0; i<q; i++)
            {
                long x = long.Parse(Console.ReadLine());
                int al = -1, bl = -1;
                int ar = a, br = b;
                while (ar - al > 1)
                {
                    int ap = (ar + al) / 2;
                    if (s[ap] > x) ar = ap;
                    else al = ap;
                } 
                while (br -bl > 1)
                {
                    int bp = (br + bl) / 2;
                    if (t[bp] > x) br = bp;
                    else bl = bp;
                }
                
                long alPos, arPos, blPos, brPos;
                if (al == -1) alPos = -10000000000;
                else alPos = s[al];
                if (ar == a) arPos = 20000000000;
                else arPos = s[ar];
                if (bl == -1) blPos = -10000000000; 
                else blPos = t[bl];
                if (br == b) brPos = 20000000000;
                else brPos = t[br];
                long ans1 = Math.Max(arPos, brPos) - x;
                long ans2 = x - Math.Min(alPos, blPos);
                long aNear = Math.Min(arPos-x, x-alPos);
                long bNear = Math.Min(brPos-x, x-blPos);
                long ans3 = aNear + bNear + Math.Min(aNear, bNear);
                long ans = Math.Min(ans1, Math.Min(ans2, ans3));
                Console.WriteLine(ans);

            }
        }
    }
    //mcs Main.cs
    //mono Main.exe

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:2:7: error: expected nested-name-specifier before 'System'
    2 | using System.Collections.Generic;
      |       ^~~~~~
a.cc:5:26: error: 'string' has not been declared
    5 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:5:35: error: expected ',' or '...' before 'args'
    5 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:53:6: error: expected ';' after class definition
   53 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void Program::Main(int*)':
a.cc:7:13: error: 'string' was not declared in this scope
    7 |             string[] input = Console.ReadLine().Split(' ');
      |             ^~~~~~
a.cc:7:20: error: expected primary-expression before ']' token
    7 |             string[] input = Console.ReadLine().Split(' ');
      |                    ^
a.cc:8:21: error: expected primary-expression before 'int'
    8 |             int a = int.Parse(input[0]), b = int.Parse(input[1]), q = int.Parse(input[2]);
      |                     ^~~
a.cc:10:17: error: structured binding declaration cannot have type 'long int'
   10 |             long[] s = new long[a];
      |                 ^~
a.cc:10:17: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:10:17: error: empty structured binding declaration
a.cc:10:20: error: expected initializer before 's'
   10 |             long[] s = new long[a];
      |                    ^
a.cc:11:37: error: 's' was not declared in this scope
   11 |             for (int i=0; i<a; i++) s[i] = long.Parse(Console.ReadLine());
      |                                     ^
a.cc:11:44: error: expected primary-expression before 'long'
   11 |             for (int i=0; i<a; i++) s[i] = long.Parse(Console.ReadLine());
      |                                            ^~~~
a.cc:13:17: error: structured binding declaration cannot have type 'long int'
   13 |             long[] t = new long[b];
      |                 ^~
a.cc:13:17: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:13:17: error: empty structured binding declaration
a.cc:13:20: error: expected initializer before 't'
   13 |             long[] t = new long[b];
      |                    ^
a.cc:14:29: error: 'b' was not declared in this scope
   14 |             for (int i=0; i<b; i++) t[i] = long.Parse(Console.ReadLine());
      |                             ^
a.cc:14:37: error: 't' was not declared in this scope
   14 |             for (int i=0; i<b; i++) t[i] = long.Parse(Console.ReadLine());
      |                                     ^
a.cc:14:44: error: expected primary-expression before 'long'
   14 |             for (int i=0; i<b; i++) t[i] = long.Parse(Console.ReadLine());
      |                                            ^~~~
a.cc:16:29: error: 'q' was not declared in this scope
   16 |             for (int i=0; i<q; i++)
      |                             ^
a.cc:18:26: error: expected primary-expression before 'long'
   18 |                 long x = long.Parse(Console.ReadLine());
      |                          ^~~~
a.cc:20:34: error: 'b' was not declared in this scope; did you mean 'br'?
   20 |                 int ar = a, br = b;
      |                                  ^
      |                                  br
a.cc:24:25: error: 's' was not declared in this scope
   24 |                     if (s[ap] > x) ar = ap;
      |                         ^
a.cc:30:25: error: 't' was not declared in this scope
   30 |                     if (t[bp] > x) br = bp;
      |                         ^
a.cc:36:30: error: 's' was not declared in this scope
   36 |                 else alPos = s[al];
      |                              ^
a.cc:38:30: error: 's' was not declared in this scope
   38 |                 else arPos = s[ar];
      |                              ^
a.cc:40:30: error: 't' was not declared in this scope
   40 |                 else blPos = t[bl];
      |                              ^
a.cc:42:30: error: 't' was not declared in this scope
   42 |                 else brPos = t[br];
      |                              ^
a.cc:43:29: error: 'Math' was not declared in this scope
   43 |                 long ans1 = Math.Max(arPos, brPos) - x;
      |                             ^~~~
a.cc:49:17: error: 'Console' was not declared in this scope
   49 |                 Console.WriteLine(ans);
      |                 ^~~~~~~