Language: C++

#include <iostream>
#include <vector>

using namespace std;

long long int my_abs(long long int x, long long int y){
  if(x > y){
    return(x-y);
  }else{
    return(y-x);
  }
}

long long int neighbor_search(int location,vector<long long int>& data){
  int s = 0;
  int e = data.size()-1;
  int m = (s+e)/2;
  if(data[e] < location){     
    return(data[e]);
  }
  while(true){
    if(m == 0){
      return(data[m]);
    }else{
      if(m==s){
	if(data[e] >= location && data[e-1] < location){
	  long long int min_i = my_abs(data[e]-location) > my_abs(data[e-1]-location) ?
	    data[e-1] : data[e];         
	  return(min_i);
	}
      }
      
      if(data[m] >= location && data[m-1] < location){
	long long int min_i = my_abs(data[m]-location) > my_abs(data[m-1]-location) ?
          data[m-1] : data[m];         
        return(min_i);
      }else if(data[m] >= location){
	e = m;	
      }else{
	s = m;
      }
      m = (s+e)/2;
    }
  }
}

int main(void){
  int a, b, q;
  cin >> a >> b >> q;
  vector<long long int> temple; temple.resize(a,0);
  vector<long long int> shrine; shrine.resize(b,0);
  for(int i = 0; i < a; i++){
   cin >> temple[i]; 
  }
  for(int i = 0; i < b; i++){
   cin >> shrine[i]; 
  }
  for(int i =0; i < q; i++){
    long long int location;
    cin >> location;
    long long int sum_a = 0;
    long long int x1 = neighbor_search(location,temple);
    long long int x2 = neighbor_search(x1,shrine);
    sum_a += my_abs(location-x1)+ my_abs(x1-x2);
    
    long long int sum_b = 0;
    long long int y1 = neighbor_search(location,shrine);
    long long int y2 = neighbor_search(y1,temple);
    sum_b += my_abs(location-y1)+ my_abs(y1-y2);
    if(sum_a > sum_b){
      cout << sum_b << endl;
    }else{
      cout << sum_a << endl;
    }
  }
}


Compiler output:
a.cc: In function 'long long int neighbor_search(int, std::vector<long long int>&)':
a.cc:27:39: error: too few arguments to function 'long long int my_abs(long long int, long long int)'
   27 |           long long int min_i = my_abs(data[e]-location) > my_abs(data[e-1]-location) ?
      |                                 ~~~~~~^~~~~~~~~~~~~~~~~~
a.cc:6:15: note: declared here
    6 | long long int my_abs(long long int x, long long int y){
      |               ^~~~~~
a.cc:27:66: error: too few arguments to function 'long long int my_abs(long long int, long long int)'
   27 |           long long int min_i = my_abs(data[e]-location) > my_abs(data[e-1]-location) ?
      |                                                            ~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:6:15: note: declared here
    6 | long long int my_abs(long long int x, long long int y){
      |               ^~~~~~
a.cc:34:37: error: too few arguments to function 'long long int my_abs(long long int, long long int)'
   34 |         long long int min_i = my_abs(data[m]-location) > my_abs(data[m-1]-location) ?
      |                               ~~~~~~^~~~~~~~~~~~~~~~~~
a.cc:6:15: note: declared here
    6 | long long int my_abs(long long int x, long long int y){
      |               ^~~~~~
a.cc:34:64: error: too few arguments to function 'long long int my_abs(long long int, long long int)'
   34 |         long long int min_i = my_abs(data[m]-location) > my_abs(data[m-1]-location) ?
      |                                                          ~~~~~~^~~~~~~~~~~~~~~~~~~~
a.cc:6:15: note: declared here
    6 | long long int my_abs(long long int x, long long int y){
      |               ^~~~~~
a.cc: In function 'int main()':
a.cc:64:20: error: too few arguments to function 'long long int my_abs(long long int, long long int)'
   64 |     sum_a += my_abs(location-x1)+ my_abs(x1-x2);
      |              ~~~~~~^~~~~~~~~~~~~
a.cc:6:15: note: declared here
    6 | long long int my_abs(long long int x, long long int y){
      |               ^~~~~~
a.cc:64:41: error: too few arguments to function 'long long int my_abs(long long int, long long int)'
   64 |     sum_a += my_abs(location-x1)+ my_abs(x1-x2);
      |                                   ~~~~~~^~~~~~~
a.cc:6:15: note: declared here
    6 | long long int my_abs(long long int x, long long int y){
      |               ^~~~~~
a.cc:69:20: error: too few arguments to function 'long long int my_abs(long long int, long long int)'
   69 |     sum_b += my_abs(location-y1)+ my_abs(y1-y2);
      |              ~~~~~~^~~~~~~~~~~~~
a.cc:6:15: note: declared here
    6 | long long int my_abs(long long int x, long long int y){
      |               ^~~~~~
a.cc:69:41: error: too few arguments to function 'long long int my_abs(long long int, long long int)'
   69 |     sum_b += my_abs(location-y1)+ my_abs(y1-y2);
      |                                   ~~~~~~^~~~~~~
a.cc:6:15: note: declared here
    6 | long long int my_abs(long long int x, long long int y){
      |               ^~~~~~