Radio Coverage

No attempts yetTime limit3sMemory limit128 MB

Problem

A base radio station broadcasts over a circular region centered at (x0,y0)(x_0, y_0) with radius RR.

To enlarge its audience, you may build relay stations at some of NN candidate sites. If a relay is built at site ii, it covers a disk centered at (xi,yi)(x_i, y_i) with radius rir_i. Every candidate site lies inside the base station's region, that is (x0xi)2+(y0yi)2R2(x_0 - x_i)^2 + (y_0 - y_i)^2 \le R^2.

Choose a subset of the sites to build relays so that:

  1. no two chosen relay disks overlap each other (they may touch);
  2. the total area covered by the base station together with all chosen relays (the area of their union) is as large as possible.

A relay disk may overlap the base station's region; only overlap between two relay disks is forbidden. Report the maximum possible total covered area.

Input

The input contains the integer NN, then the real numbers x0x_0, y0y_0, RR, then NN triples of real numbers xix_i, yiy_i, rir_i. Values are separated by whitespace and may span multiple lines.

Output

Print the maximum total covered area, rounded to 44 decimal places.

Constraints

  • 1N101 \le N \le 10
  • 0xi,yi,x0,y010000 \le x_i, y_i, x_0, y_0 \le 1000
  • 1riR10001 \le r_i \le R \le 1000