{$apptype console}

uses
  Math, SysUtils;

function MySqrt(Num: double): double;
begin
  if (Num > 0.0) then
    Result := Sqrt(Num)
  else
    Result := 0.0;
end;


function MyArcCos(Value: double): double;
begin
  if (Abs(Value) < 1.0) then
    Result := ArcCos(Value)
  else if (Value > 0.0) then
    Result := 0.0
  else
    Result := Pi;
end;


function Length(x1, y1, x2, y2: double): double;
begin
  Result := MySqrt(Sqr(x1 - x2) + Sqr(y1 - y2));
end;


function FloatCompare(F1, F2: double): integer;
var
  t: double;
begin
  t := F1 - F2;
  if (Abs(t) < 1e-10) then
    Result := 0
  else if (t > 0) then
    Result := 1
  else
    Result := -1;
end;


var
  i, j, k, N: integer;
  x0, y0, R: double;
  xi, yi, ri, addS: array [1..10] of double;
  s, p, l, alpha, beta: double;
  mask, t: integer;
  subSet: array[1..10] of boolean;
  good: boolean;
  maxS, curS: double;
begin
  Read(N);
  Read(x0, y0, R);
  maxS := Pi * Sqr(R);
  for i := 1 to N do
    Read(xi[i], yi[i], ri[i]);
  for i := 1 to N do begin
    l := Length(x0, y0, xi[i], yi[i]);
    if (FloatCompare(l + ri[i], R) <= 0) then
      addS[i] := 0.0
    else begin
      try
        p := (l + R + ri[i]) / 2.0;
        s := 2 * MySqrt(p * (p - l) * (p - R) * (p - ri[i]));
        alpha := Pi - MyArcCos((Sqr(ri[i]) + Sqr(l) - Sqr(R)) / (2 * ri[i] * l));
        beta := MyArcCos((Sqr(R) + Sqr(l) - Sqr(ri[i])) / (2 * R * l));
        addS[i] := alpha * Sqr(ri[i]) + s - beta * Sqr(R);
      except
        addS[i] := 0.0;
      end;
    end;
  end;
  for k := 0 to 1 shl N - 1 do begin
    FillChar(subSet, SizeOf(subSet), 0);
    t := k;
    for j := 1 to N do begin
      if (t mod 2 = 1) then
        subSet[j] := true;
      t := t div 2;
    end;
    good := true;
    for i := 1 to N - 1 do
      if subSet[i] then
        for j := i + 1 to N do
          if subSet[j] then
            if (FloatCompare(Length(xi[i], yi[i], xi[j], yi[j]), ri[i] + ri[j]) < 0) then
              good := false;
    if good then begin
      curS := Pi * Sqr(R);
      for i := 1 to N do
        if subSet[i] then
          curS := curS + addS[i];
      if (curS > maxS) then
        maxS := curS;
    end;
  end;
  DecimalSeparator := '.';
  Write(Format('%0.4f', [maxS]));
end.
