Language: C++

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef double db;
typedef vector <ll> vll;
typedef pair <ll, ll> pll;
#define pb push_back
#define mp make_pair
#define MAX 1000000
#define mod 1000000007
#define all(_) _.begin(), _.end()
#define F first
#define S second
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
db slope(db x, db y)
{
    if(x == 0)
        return ((y < 0 ? (db)1.5 : (db)0.5) * M_PI);
    db an = atan2(y / x);
    if(an >= 0)
    {
        if(x < 0 || y < 0)
            an += M_PI;
    }
    else
    {
        if(x > 0)
            an += 2 * M_PI;
        else
            an += M_PI;
    }
    return an;
}
bool c(pll a, pll b)
{
    return slope(a.F, a.S) < slope(b.F, b.S);
}
int main()
{
    ios_base :: sync_with_stdio(false);
    cin.tie(NULL), cout.tie(NULL);
    ll n, i, j;
    db ans = 0.0000000000000000000000;
    cin >> n;
    vector <pll> a(n);
    for(i = 0; i < n; i++)
        cin >> a[i].F >> a[i].S;
    sort(all(a), c);
    for(i = 0; i < n; i++)
    {
        ll x = 0, y = 0;
        for(j = i; j < n; j++)
        {
            x += a[j].F;
            y += a[j].S;
            ans = max(ans, (db)sqrtl(x * x + y * y));
        }
    }
    printf("%.12lf\n", ans);
    return 0;
}

Compiler output:
a.cc: In function 'db slope(db, db)':
a.cc:22:18: error: no matching function for call to 'atan2(db)'
   22 |     db an = atan2(y / x);
      |             ~~~~~^~~~~~~
In file included from /usr/include/c++/14/valarray:605,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:166,
                 from a.cc:1:
/usr/include/c++/14/bits/valarray_after.h:548:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Atan2, std::_Constant, std::_ValArray, _Tp, _Tp>, _Tp> std::atan2(const typename valarray<_Tp>::value_type&, const valarray<_Tp>&)'
  548 | _DEFINE_EXPR_BINARY_FUNCTION(atan2, struct std::_Atan2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:548:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/valarray_after.h:548:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Atan2, std::_ValArray, std::_Constant, _Tp, _Tp>, _Tp> std::atan2(const valarray<_Tp>&, const typename valarray<_Tp>::value_type&)'
  548 | _DEFINE_EXPR_BINARY_FUNCTION(atan2, struct std::_Atan2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:548:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/valarray_after.h:548:1: note: candidate: 'template<class _Tp> std::_Expr<std::__detail::_BinClos<std::_Atan2, std::_ValArray, std::_ValArray, _Tp, _Tp>, _Tp> std::atan2(const valarray<_Tp>&, const valarray<_Tp>&)'
  548 | _DEFINE_EXPR_BINARY_FUNCTION(atan2, struct std::_Atan2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:548:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/valarray_after.h:548:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Atan2, std::_Constant, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::atan2(const typename _Dom::value_type&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  548 | _DEFINE_EXPR_BINARY_FUNCTION(atan2, struct std::_Atan2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:548:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/valarray_after.h:548:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Atan2, std::_Expr, std::_Constant, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::atan2(const _Expr<_Dom1, typename _Dom1::value_type>&, const typename _Dom::value_type&)'
  548 | _DEFINE_EXPR_BINARY_FUNCTION(atan2, struct std::_Atan2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:548:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/valarray_after.h:548:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Atan2, std::_ValArray, std::_Expr, typename _Dom::value_type, _Dom>, typename _Dom::value_type> std::atan2(const valarray<typename _Dom::valarray>&, const _Expr<_Dom1, typename _Dom1::value_type>&)'
  548 | _DEFINE_EXPR_BINARY_FUNCTION(atan2, struct std::_Atan2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:548:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/valarray_after.h:548:1: note: candidate: 'template<class _Dom> std::_Expr<std::__detail::_BinClos<std::_Atan2, std::_Expr, std::_ValArray, _Dom, typename _Dom::value_type>, typename _Dom::value_type> std::atan2(const _Expr<_Dom1, typename _Dom1::value_type>&, const valarray<typename _Dom::value_type>&)'
  548 | _DEFINE_EXPR_BINARY_FUNCTION(atan2, struct std::_Atan2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:548:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/valarray_after.h:548:1: note: candidate: 'template<class _Dom1, class _Dom2> std::_Expr<std::__detail::_BinClos<std::_Atan2, std::_Expr, std::_Expr, _Dom1, _Dom2>, typename _Dom1::value_type> std::atan2(const _Expr<_Dom1, typename _Dom1::value_type>&, const _Expr<_Dom2, typename _Dom2::value_type>&)'
  548 | _DEFINE_EXPR_BINARY_FUNCTION(atan2, struct std::_Atan2)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/valarray_after.h:548:1: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:114:
/usr/include/c++/14/cmath:1056:5: note: candidate: 'template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::atan2(_Tp, _Up)'
 1056 |     atan2(_Tp __y, _Up __x)
      |     ^~~~~
/usr/include/c++/14/cmath:1056:5: note:   candidate expects 2 arguments, 1 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:59:1: note: candidate: 'double atan2(double, double)'
   59 | __MATHCALL_VEC (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:59:1: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:154:3: note: candidate: 'constexpr long double std::atan2(long double, long double)'
  154 |   atan2(long double __y, long double __x)
      |   ^~~~~
/usr/include/c++/14/cmath:154:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/cmath:150:3: note: candidate: 'constexpr float std::atan2(float, float)'
  150 |   atan2(float __y, float __x)
      |   ^~~~~
/usr/include/c++/14/cmath:150:3: note:   candidate expects 2 arguments, 1 provided