#include <iostream>
#include <vector>
#include <iomanip>

using namespace std;

class range {
private:
  struct Iterator {
    int val;
    int operator*() {return val;}
    bool operator!=(Iterator &itr) {return val < itr.val;}
    void operator++() {++val;}
  };
  Iterator i, n;
public:
  range(int n) : i({0}), n({n}) {}
  range(int i, int n) : i({i}), n({n}) {}
  Iterator &begin() {return i;}
  Iterator &end() {return n;}
};

template<class T> T at(vector<T> v, int i) {return v[(i % (int)v.size() + v.size()) % v.size()];}

#include <algorithm>
#include <complex>

#define X real()
#define Y imag()

typedef long double Real;
typedef complex<Real> Point;
struct Line{Point a, b;};
typedef vector<Point> Polygon;

const Real EPS = 1e-8;
const Real PI = acos(-1);

// 比較関数
inline int sgn(Real a, Real b = 0) {return a < b - EPS ? -1 : a > b + EPS ? 1 : 0;}
inline bool near(Point a, Point b) {return !sgn(abs(a - b));}
namespace std {
  inline bool operator<(Point a, Point b) {return sgn(a.X, b.X) ? a.X < b.X : a.Y < b.Y;}
  inline bool operator<(Line a, Line b) {return !near(a.a, b.a) ? a.a < b.a : a.b < b.b;}
}

// 平方根
inline Real sr(Real a) {return sqrt(max(a, (Real)0));}

// 内積
inline Real dot(const Point &a, const Point &b) {return a.X * b.X + a.Y * b.Y;}
// 外積
inline Real det(const Point &a, const Point &b) {return a.X * b.Y - a.Y * b.X;}

// 線分のベクトル
inline Point vec(const Line &a) {return a.b - a.a;}

// 線分abに対する点cの位置
enum CCW{FRONT = 1, RIGHT = 2, BACK = 4, LEFT = 8, ON = 16};
inline int ccw(const Point &a, const Point &b, const Point &c) {
  if (near(a, c) || near(b, c)) return ON;
  int s = sgn(det(b - a, c - a));
  if (s) return s > 0 ? LEFT : RIGHT;
  return (a < b) == (b < c) ? FRONT : (c < a) == (a < b) ? BACK : ON;
}

// 有向角度
inline Real arg(const Point &base, const Point &a, const Point &b) {return arg((b - base) / (a - base));}
Line sortBase;
inline bool lessArg(const Point &a, const Point &b) {
  Real ang1 = arg(sortBase.a, sortBase.b, a);
  Real ang2 = arg(sortBase.a, sortBase.b, b);
  return sgn(ang1, ang2) ? ang1 < ang2 : norm(a) > norm(b);
}

// 射影
inline Point proj(const Point &a, const Point &b) {return a * dot(a, b) / norm(a);}
inline Point perp(const Line &l, const Point &p) {return l.a + proj(vec(l), p - l.a);}
inline Point refl(const Line &l, const Point &p) {return perp(l, p) * (Real)2 - p;}

// 交差判定
inline bool eqL(const Line &a, const Line &b) {return !sgn(det(vec(a), vec(b))) && !sgn(det(vec(a), b.a - a.a));}
inline bool iLL(const Line &a, const Line &b, bool strict = false) {
  if (strict) return sgn(det(vec(a), vec(b)));
  return sgn(det(vec(a), vec(b))) || !sgn(det(vec(a), b.a - a.a));
}
inline bool iLS(const Line &a, const Line &b, bool strict = false) {
  if (strict) return sgn(det(vec(a), b.a - a.a)) * sgn(det(vec(a), b.b - a.a)) < 0;
  return sgn(det(vec(a), b.a - a.a)) * sgn(det(vec(a), b.b - a.a)) <= 0;
}
inline bool iSS(const Line &a, const Line &b, bool strict = false) {
  int cwa = ccw(a.a, a.b, b.a) | ccw(a.a, a.b, b.b);
  int cwb = ccw(b.a, b.b, a.a) | ccw(b.a, b.b, a.b);
  if (strict) return (cwa & cwb) == (LEFT | RIGHT);
  return ((cwa | cwb) & ON) || ((cwa & cwb) == (LEFT | RIGHT));
}

// 交点
inline Point pLL(const Line &a, const Line &b) {return a.a + vec(a) * (det(vec(b), b.a - a.a) / det(vec(b), vec(a)));}

// 距離
inline Real dLP(const Line &l, const Point &p) {return abs(det(vec(l), p - l.a) / vec(l));}
inline Real dSP(const Line &s, const Point &p) {
  if (dot(vec(s), p - s.a) < 0) return abs(p - s.a);
  if (dot(vec(s), p - s.b) > 0) return abs(p - s.b);
  return dLP(s, p);
}
inline Real dLL(const Line &a, const Line &b) {return iLL(a, b) ? 0 : dLP(a, b.a);}
inline Real dLS(const Line &a, const Line &b) {return iLS(a, b) ? 0 : min(dLP(a, b.a), dLP(a, b.b));}
inline Real dSS(const Line &a, const Line &b) {return iSS(a, b) ? 0 : min(min(dSP(a, b.a), dSP(a, b.b)), min(dSP(b, a.a), dSP(b, a.b)));}

// 円
struct Circle{Point c; Real r;};

// 2円の位置関係
enum RELATION{SAME = 1, CONTAIN = 2, OVER = 4, NO_CROSS = 8, ONE_CROSS = 16, ONE_CONTAIN_CROSS = 32, ONE_OVER_CROSS = 64, TWO_CROSS = 128};
inline int cRel(const Circle &c1, const Circle &c2) {
  Real d = abs(c1.c - c2.c);
  if (near(c1.c, c2.c) && !sgn(c1.r, c2.r)) return SAME;
  if (sgn(d, c1.r - c2.r) < 0) return OVER;
  if (sgn(d, c2.r - c1.r) < 0) return CONTAIN;
  if (!sgn(d, c1.r - c2.r)) return ONE_OVER_CROSS;
  if (!sgn(d, c2.r - c1.r)) return ONE_CONTAIN_CROSS;
  if (!sgn(d, c1.r + c2.r)) return ONE_CROSS;
  if (sgn(d, c1.r + c2.r) > 0) return NO_CROSS;
  return TWO_CROSS;
}

// 交差判定
inline bool iCP(const Circle &c, const Point &p) {return sgn(abs(p - c.c), c.r) <= 0;}
inline bool iCL(const Circle &c, const Line &l) {return sgn(c.r, dLP(l, c.c)) >= 0;}
inline bool iCS(const Circle &c, const Line &s) {return sgn(c.r, dSP(s, c.c)) >= 0;}
inline bool iCSc(const Circle &c, const Line &s) {return iCS(c, s) && sgn(c.r, max(abs(s.a - c.c), abs(s.b - c.c))) >= 0;}
inline bool iCC(const Circle &a, const Circle &b) {return sgn(abs(a.c - b.c), a.r + b.r) <= 0;}
inline bool iCCc(const Circle &a, const Circle &b) {return iCC(a, b) && sgn(abs(a.c - b.c), abs(a.r - b.r)) >= 0;}

// 交点
inline pair<Point, Point> pCC(const Circle &a, const Circle &b) {
  Real x = (norm(a.c - b.c) + a.r * a.r - b.r * b.r) / (2 * abs(a.c - b.c));
  Point e = (b.c - a.c) / abs(b.c - a.c);
  Point y = e * Point(0, sr(a.r * a.r - x * x));
  return make_pair(a.c + e * x - y, a.c + e * x + y);
}
inline pair<Point, Point> pCL(const Circle &c, const Line &l) {
  Point x = perp(l, c.c);
  Point y = vec(l) / abs(vec(l)) * sr(c.r * c.r - norm(x - c.c));
  return make_pair(x - y, x + y);
}

// 角の内外判定 角abの内部にあれば正、辺上は0、外部は負
inline int sAP(const Point &a, const Point &b, const Point &c) {return sgn(det(a, c)) - sgn(det(b, c)) - sgn(det(a, b));}

// 多角形の面積
inline Real aPol(const Polygon &vp) {Real ret = 0; for (int i : range(vp.size())) ret += det(vp[i], at(vp, i + 1)); return ret / 2;}

// 多角形の内外判定 内部:1、周上:0、外部:-1
inline int sGP(const Polygon &pol, const Point &p) {
  int side = -1;
  for (int i : range(pol.size())) {
    Point p0 = pol[i] - p, p1 = at(pol, i + 1) - p;
    if (ccw(p0, p1, 0) == ON) return 0;
    if (p0.Y > p1.Y) swap(p0, p1);
    if (sgn(p0.Y) <= 0 && 0 < sgn(p1.Y) && sgn(det(p0, p1)) > 0) side *= -1;
  }
  return side;
}

// 凸包
inline Polygon convexHull(Polygon p) {
  int m = -1, n = p.size();
  if (n < 3) return p;
  vector<Point> q(n * 2);
  sort(p.begin(), p.end());
  for (int i = 0; i < n; q[++m] = p[i++]) for (; m > 0 && ccw(q[m - 1], q[m], p[i]) != LEFT; --m);
  for (int i = n - 2, r = m; i >= 0; q[++m] = p[i--]) for (; m > r && ccw(q[m - 1], q[m], p[i]) != LEFT; --m);
  q.resize(m);
  return q;
}

// 凸多角形カット
inline Polygon convexCut(const Polygon &p, const Line &l) {
  vector<Point> q;
  for (int i : range(p.size())) {
    if (ccw(l.a, l.b, p[i]) != RIGHT) q.emplace_back(p[i]);
    Line s = {p[i], at(p, i + 1)};
    if (iLS(l, s, true)) q.emplace_back(pLL(l, s));
  }
  return q;
}

// 線分をマージする
inline void merge(vector<Line> &vs) {
  for (Line s : vs) if (s.b < s.a) swap(s.a, s.b);
  sort(vs.begin(), vs.end());
  for (int i : range(vs.size())) for (int j : range(i)) if (iSS(vs[i], vs[j]) && !iLL(vs[i], vs[j], true)) {
    vs[j].b = max(vs[i].b, vs[j].b);
    vs.erase(vs.begin() + i--);
    break;
  }
}

// 線分アレンジメント 隣の点への辺のみを持つ
inline void sArr(vector<Line> &vs, vector<Point> &vp, vector<vector<int>> &g) {
  merge(vs);
  for (Line s : vs) {
    vp.emplace_back(s.a);
    vp.emplace_back(s.b);
  }
  for (int i : range(vs.size())) for (int j : range(i)) if (iSS(vs[i], vs[j])) vp.emplace_back(pLL(vs[i], vs[j]));
  sort(vp.begin(), vp.end());
  vp.erase(unique(vp.begin(), vp.end(), near), vp.end());
  g = vector<vector<int>>(vp.size());
  for (Line s : vs) {
    vector<pair<Real, int>> v;
    for (int j : range(vp.size())) if (ccw(s.a, s.b, vp[j]) == ON) v.emplace_back(make_pair(norm(vp[j] - s.a), j));
    sort(v.begin(), v.end());
    for (int j : range(v.size() - 1)) {
      g[v[j + 1].second].emplace_back(v[j].second);
      g[v[j].second].emplace_back(v[j + 1].second);
    }
  }
}

// 円と多角形の共通部分面積
inline Real aCTnc(Real r, const Point &p1, const Point &p2) {return sgn(abs((p1 + p2) / (Real)2), r) <= 0 ? det(p1, p2) / 2 : r * r * arg(0, p1, p2) / 2;}
inline Real aCT(Real r, const Point &p1, const Point &p2) {
  if (!sgn(r) || near(0, p1) || near(0, p2) || near(p1, p2)) return 0;
  pair<Point, Point> pp = pCL((Circle){0, r}, (Line){p1, p2});
  if ((p1 < pp.first) != (pp.first < p2) && (p1 < pp.second) != (pp.second < p2)) return aCTnc(r, p1, p2);
  return aCTnc(r, p1, pp.first) + aCTnc(r, pp.first, pp.second) + aCTnc(r, pp.second, p2);
}
inline Real aCPol(const Circle &c, const Polygon &pol) {Real res = 0; for (int i : range(pol.size())) res += aCT(c.r, pol[i] - c.c, at(pol, i + 1) - c.c); return res;}

int main() {
  int n;
  Circle c;
  Real x, y, r;
  cin >> n >> x >> y >> r;
  c = (Circle){Point(x, y), r};
  Real res = 0;
  for (int _ : range(n)) {
    int p, score;
    cin >> p >> score;
    Polygon pol(p);
    for (int i : range(p)) {
      cin >> x >> y;
      pol[i] = Point(x, y);
    }
    Real area = aCPol(c, pol);
    res += area / (r * r * PI) * score;
  }
  cout << fixed << setprecision(15) << res << endl;
}


Measured memory_bytes: 1320