Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;

    vector<double> x(n);
    vector<double> y(n);
    for(int i = 0; i < n; i++){
        cin >> x[i] >> y[i];
    }

    double cnt = 0;
    double sum = 0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i == j)
                continue;
            double absx = fabs(x[i]-x[j],2);
            double absy = fabs(y[i]-y[j],2);
            sum += sqrt(absx + absy);
            cnt++;
        }
    }

    double ans = sum / cnt;

    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:31: error: no matching function for call to 'fabs(__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type, int)'
   20 |             double absx = fabs(x[i]-x[j],2);
      |                           ~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127,
                 from a.cc:1:
/usr/include/c++/14/complex:2429:5: note: candidate: 'template<class _Tp> _Tp std::fabs(const complex<_Tp>&)'
 2429 |     fabs(const std::complex<_Tp>& __z)
      |     ^~~~
/usr/include/c++/14/complex:2429:5: note:   candidate expects 1 argument, 2 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114:
/usr/include/c++/14/cmath:250:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::fabs(_Tp)'
  250 |     fabs(_Tp __x)
      |     ^~~~
/usr/include/c++/14/cmath:250:5: note:   candidate expects 1 argument, 2 provided
In file included from /usr/include/features.h:523,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683,
                 from /usr/include/c++/14/cassert:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:33:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:195:1: note: candidate: 'double fabs(double)'
  195 | __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:195:1: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:242:3: note: candidate: 'constexpr long double std::fabs(long double)'
  242 |   fabs(long double __x)
      |   ^~~~
/usr/include/c++/14/cmath:242:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:238:3: note: candidate: 'constexpr float std::fabs(float)'
  238 |   fabs(float __x)
      |   ^~~~
/usr/include/c++/14/cmath:238:3: note:   candidate expects 1 argument, 2 provided
a.cc:21:31: error: no matching function for call to 'fabs(__gnu_cxx::__alloc_traits<std::allocator<double>, double>::value_type, int)'
   21 |             double absy = fabs(y[i]-y[j],2);
      |                           ~~~~^~~~~~~~~~~~~
/usr/include/c++/14/complex:2429:5: note: candidate: 'template<class _Tp> _Tp std::fabs(const complex<_Tp>&)'
 2429 |     fabs(const std::complex<_Tp>& __z)
      |     ^~~~
/usr/include/c++/14/complex:2429:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:250:5: note: candidate: 'template<class _Tp> constexpr typename __gnu_cxx::__enable_if<std::__is_integer<_Tp>::__value, double>::__type std::fabs(_Tp)'
  250 |     fabs(_Tp __x)
      |     ^~~~
/usr/include/c++/14/cmath:250:5: note:   candidate expects 1 argument, 2 provided
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:195:1: note: candidate: 'double fabs(double)'
  195 | __MATHCALLX (fabs,, (_Mdouble_ __x), (__const__));
      | ^~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:195:1: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:242:3: note: candidate: 'constexpr long double std::fabs(long double)'
  242 |   fabs(long double __x)
      |   ^~~~
/usr/include/c++/14/cmath:242:3: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/cmath:238:3: note: candidate: 'constexpr float std::fabs(float)'
  238 |   fabs(float __x)
      |   ^~~~
/usr/include/c++/14/cmath:238:3: note:   candidate expects 1 argument, 2 provided