@staticmethod
def d():
    (n, d, x, y) = map(int, sys.stdin.read().split())
    (x, y) = (abs(x), abs(y))
    if ((x % d) or (y % d)):
        print(0)
        return
    (x, y) = ((x // d), (y // d))
    r = (n - (x + y))
    if ((r < 0) or (r & 1)):
        print(0)
        return
    res = 0
    half_p = pow((1 / 2), n)
    for d in range(((r // 2) + 1)):
        (south, north) = (d, (y + d))
        west = ((r - (2 * d)) // 2)
        res += ((((half_p * comb(n, south, exact=True)) * comb((n - south), north, exact=True)) * comb(((n - south) - north), west, exact=True)) * half_p)
    print(res)
@staticmethod
def d():
    (n, d, x, y) = map(int, sys.stdin.read().split())
    (x, y) = (abs(x), abs(y))
    if ((x % d) or (y % d)):
        print(0)
        return
    (x, y) = ((x // d), (y // d))
    r = (n - (x + y))
    if ((r < 0) or (r & 1)):
        print(0)
        return
    res = 0
    half_p = pow((1 / 2), n)
    for d in range(((r // 2) + 1)):
        (south, north) = (d, (y + d))
        west = ((r - (2 * d)) // 2)
        res += ((((half_p * comb(n, south, exact=True)) * comb((n - south), north, exact=True)) * comb(((n - south) - north), west, exact=True)) * half_p)
    print(res)