Language: C++

// see https://github.com/LumaKernel/vimfiles/tree/master/snippets/cp-cpp/temp.snip
/// --- .lumrc Template {{{ ///
#if 0
#define assert(...)
#endif
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using P3 = tuple<ll, ll, ll>;
using VI = vector<int>;
using VL = vector<ll>;
using VVI = vector<VI>;
using VVL = vector<VL>;
using VS = vector<string>;

#define omajinai ios::sync_with_stdio(false);cin.tie(0)

#define FOR(i,a,b) for(int i=int(a);i<int(b);++i)
#define FORI(i,a,b) for(int i=int(a);i<=int(b);++i)
#define REP(i,n) FOR(i,0,n)
#define REPI(i,n) FORI(i,0,n)
#define RFOR(i,a,b) for(int i=int(b)-1;i>=int(a);--i)
#define RFORI(i,a,b) for(int i=int(b);i>=int(a);--i)
#define RREP(i,n) RFOR(i,0,n)
#define RREPI(i,n) RFORI(i,0,n)

#define ALL(a) (a).begin(),(a).end()
#define UNIQUE(a) (a).erase(unique(ALL(a)),(a).end())
#define PB push_back
#define EACH(i,c) REP(i,(c).size())
#define REACH(i,c) RREP(i,(c).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(ALL(c))

#define BR cout<<"\n";

#ifdef DEBUG
#define dump(...) cerr<<"["<<__LINE__<< "] "<<#__VA_ARGS__<<" = "<<make_tuple(__VA_ARGS__)<<"\n";
#else
#define dump(...)
#endif

#define YES(x) cout<<((x)?"YES":"NO")<<"\n";
#define Yes(x) cout<<((x)?"Yes":"No")<<"\n";
#define yes(x) cout<<((x)?"yes":"no")<<"\n";

inline int omajinai_int_in(){omajinai;int n;cin>>n;return n;}
inline ll omajinai_ll_in(){omajinai;ll n;cin>>n;return n;}
inline string omajinai_string_in(){omajinai;string n;cin>>n;return n;}
inline int int_in(){int n;cin>>n;return n;}
inline ll ll_in(){ll n;cin>>n;return n;}
inline string string_in(){string n;cin>>n;return n;}
#define oini omajinai_int_in()
#define oinl omajinai_ll_in()
#define oins omajinai_string_in()
#define ini int_in()
#define inl ll_in()
#define ins string_in()

#define MP make_pair

#define isInside(y,x) (0<=(y)&&(y)<h&&0<=(x)&&(x)<w)

#define fi(x) (get<0>(x))
#define se(x) (get<1>(x))
#define th(x) (get<2>(x))
#define fo(x) (get<3>(x))
#define fif(x) (get<4>(x))

template <typename T> ostream &operator<<(ostream &o, const vector<T> &v) { o << '{'; EACH(i, v) o << v[i] << (i != v.size()-1 ? ", " : ""); o << "}";  return o; }

template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":", ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream & os, tuple<T...> const & t){ _ot<0>(os, t); return os; }

template <typename T> inline void smax(T &a, T b) { a = a > b ? a : b; }
template <typename T> inline void smin(T &a, T b) { a = a < b ? a : b; }

constexpr double PI = acos(-1);

/// }}}--- ///

constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18+1;
constexpr int MOD = 1e9+7;


typedef complex<double> P;
#define X real()
#define Y imag()
#define dot(a, b) (conj(a) * (b)).X
#define cross(a, b) (conj(a) * (b)).Y
 
int sqri(double a)
{
    return (int)(a * a);
}
 
struct edge
{
    int a, b, cost2;
    bool operator<(const edge &a) const
    {
        return cost2 < a.cost2;
    }
};
 
 
int v, r;
int x[100], y[100];
pair<P, int> pts[100];
 
int dist2(int a, int b)
{
    return sqri(
               x[a] - x[b]) +
           sqri(
               y[a] - y[b]);
}
 
P p; // base point
 
namespace std
{
const bool operator<(P a, P b) // polar compare
{
    a -= p;
    b -= p;
    // a.Y/a.X < b.Y/b.X
    return a.Y * b.X < a.X * b.Y;
}
}
 
double ccw(P a, P b, P c)
{
    a -= b;
    c -= b;
    return cross(a, c);
}
 
int convex[200];
 

double tht(P a,P b,P c){
  a-=c;b-=c;
  return abs(dot(a,b)/pow(dist2(a.X,a.Y),2)/pow(dist2(b.X,b.Y),2));
}

double ans[100];
// graham scan
// to make convex hull
P cent;
int scan()
{
    int m = 0;
    sort(pts + 1, pts + v);
    REP(i, v)
    {
        while (m > 1 && ccw(pts[i].first, pts[convex[m - 2]].first, pts[convex[m - 1]].first) > 0)
            m--;
        convex[m] = i;
        m++;
    }
    REP(i, m)
    {
        int p = pts[convex[i]].second;
      cent.X += pts[p].X/m;
      cent.Y += pts[p].Y/m;
    }
    REP(i, m)
    {
        int p = pts[convex[i]].second;
        int p1 = pts[convex[(i - 1 + m) % m]].second;
        int p2 = pts[convex[(i + 1) % m]].second;
        ans[p] += tht(pts[p].first,pts[p1].first,cent)/2;
        ans[p] += tht(pts[p].first,pts[p2].first,cent)/2;
          
    }
    return m;
}

int main() {
  int n=ini;
  REP(i,n) {
    x[i]=ini;y[i]=ini;
    pts[i]=MP(P(x[i],y[i]),i);
  }
  scan();
  REP(i,n){
    cout<<setprecision(6)<<ans[i]<<endl;
  }
}

//


Compiler output:
a.cc: In function 'int scan()':
a.cc:92:11: error: 'struct std::pair<std::complex<double>, int>' has no member named 'real'
   92 | #define X real()
      |           ^~~~
a.cc:170:24: note: in expansion of macro 'X'
  170 |       cent.X += pts[p].X/m;
      |                        ^
a.cc:93:11: error: 'struct std::pair<std::complex<double>, int>' has no member named 'imag'
   93 | #define Y imag()
      |           ^~~~
a.cc:171:24: note: in expansion of macro 'Y'
  171 |       cent.Y += pts[p].Y/m;
      |                        ^