#!/usr/bin/python3

import math
from cmath import *

def crossproduct(a, b):
    return (a.conjugate() * b).imag

def dotproduct(a, b):
    return (a.conjugate() * b).real

def signedTriangleArea(a, b, c):
    return crossproduct(b-a, c-a) / 2.0

def angle_to(a, b):
    return math.acos(dotproduct(a, b) / abs(a) / abs(b))
 
def project(b, a):
    return b * (dotproduct(a, b) / abs(b)**2)
    
def project_point_on_line(line, a):
    p, q = line
    return p + project(q-p, a-p)

def is_point_within_segment(line, r):
    p, q = line
    return abs(abs(p-q) - abs(p-r) - abs(q-r)) <= 1e-6

def intersect_line_circle(line, circle):
    p, q = line
    d = q - p
    c, R = circle
    x = project_point_on_line(line, c)
    D = abs(x - c)
    if D > R + 1e-6: return []
    h = math.sqrt(max(0, R * R - D * D))
    if h == 0: return [x]
    return [ x + d / abs(d) * h, x - d / abs(d) * h ]

n, r, w, h = map(int, input().split())

bottom = complex(w, 0), complex(0, 0)
top = complex(w, h), complex(0, h)
left = complex(0, h), complex(0, 0)
right = complex(w, 0), complex(w, h)

exp = .0
for i in range(n):
    x, y, v = map(int, input().split())
    C = complex(x, y)
    plant = C, r

    def sector(p1, p2):
        return angle_to(p1 - C, p2 - C) * r * r / 2.0

    area = 0
    for side in [left, top, right, bottom]:
        p = intersect_line_circle(side, plant)
        b, a = side
        if len(p) < 2:
            area += sector(b, a)
        else:
            if is_point_within_segment(side, p[0]):
                area += sector(a, p[0])
                a = p[0]
            if is_point_within_segment(side, p[1]):
                area += sector(p[1], b)
                b = p[1]

            area += abs(signedTriangleArea(C, a, b))

    exp += area/(w*h)*v

print (exp)

