Language: C++

#include <bits/stdc++.h>
#define INF (1ll<<60)
#define MOD 1000000007
#define BOUND 27182818284
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	int a, b, q; cin >> a >> b >> q;
	vector<ll> s(a+2);
	vector<ll> t(b+2);
	s.front() = t.front() = -BOUND;
	s.back() = t.back() = BOUND;
	for( int i = 1; i < a+1; ++i ){
		cin >> s[i];
	}
	for( int i = 1; i < b+1; ++i ){
		cin >> t[i];
	}
	for( int i = 0; i < q; ++i ){
		ll v; cin >> v;
		ll sb = upper_bound( s.begin(), s.end(), v ) - s.begin();
		ll sa = sb-1;
		sb = s[sb]; sa = s[sa];
		ll td = upper_bound( t.begin(), t.end(), v ) - t.begin();
		ll tc = td-1;
		td = t[td]; tc = t[tc];
		ll ans = min({ abs(sa-v)+abs(tc-sa), abs(sa-v)+abs(td-sa), abs(sb-v)+abs(tc-sb), abs(sb-v)+abs(td-sb),  abc(tc-v)+abs(sa-tc), abs(tc-v)+abs(sb-tc), abc(td-v)+abs(sa-td), abs(td-v)+abs(sb-td) });
		cout << ans << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:121: error: 'abc' was not declared in this scope; did you mean 'abs'?
   29 |                 ll ans = min({ abs(sa-v)+abs(tc-sa), abs(sa-v)+abs(td-sa), abs(sb-v)+abs(tc-sb), abs(sb-v)+abs(td-sb),  abc(tc-v)+abs(sa-tc), abs(tc-v)+abs(sb-tc), abc(td-v)+abs(sa-td), abs(td-v)+abs(sb-td) });
      |                                                                                                                         ^~~
      |                                                                                                                         abs
a.cc:29:29: error: no matching function for call to 'min(<brace-enclosed initializer list>)'
   29 |                 ll ans = min({ abs(sa-v)+abs(tc-sa), abs(sa-v)+abs(td-sa), abs(sb-v)+abs(tc-sb), abs(sb-v)+abs(td-sb),  abc(tc-v)+abs(sa-tc), abs(tc-v)+abs(sb-tc), abc(td-v)+abs(sa-td), abs(td-v)+abs(sb-td) });
      |                          ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   candidate expects 2 arguments, 1 provided