import sys

input = sys.stdin.buffer.readline

import copy

 

def main():

    N,A,B,K = list(map(int,input().split()))

    

    MOD = 998244353

    fac = [0 for _ in range(N+1)]

    fac[0],fac[1] = 1,1

    inv = copy.deepcopy(fac)

    invfac = copy.deepcopy(fac)

    

    for i in range(2,N+1):

        fac[i] = (fac[i-1]*i)%MOD

        inv[i] = MOD-(MOD//i)*inv[MOD%i]%MOD

        invfac[i] = (invfac[i-1]*inv[i])%MOD

 

    def coef(x,y):

        num = (((fac[x]*invfac[y])%MOD)*invfac[x-y]%MOD)

        return num

        

    ans = 0

    for i in range(min(K//max(A,B),N)+1):

        rest = K-i*max(A,B)

        if rest%min(A,B) == 0:

            j = rest//min(A,B)

            if j <= N:

                ans += coef(N,i)*coef(N,j)

                ans %= MOD

            

    print(ans)

    

if __name__ == "__main__":

    main()

import sys

input = sys.stdin.buffer.readline

import copy

 

def main():

    N,A,B,K = list(map(int,input().split()))

    

    MOD = 998244353

    fac = [0 for _ in range(N+1)]

    fac[0],fac[1] = 1,1

    invfac = copy.deepcopy(fac)

    

    for i in range(2,N+1):

        fac[i] = (fac[i-1]*i)%MOD

    

    invfac[-1] = pow(fac[-1],MOD-2,MOD)

    for i in range(N,0,-1):

        invfac[i-1] = (invfac[i]*i)%MOD

 

    def coef(x,y):

        num = (((fac[x]*invfac[y])%MOD)*invfac[x-y]%MOD)

        return num



    ans = 0

    for i in range(min(K//max(A,B),N)+1):

        rest = K-i*max(A,B)

        if rest%min(A,B) == 0:

            j = rest//min(A,B)

            if j <= N:

                ans += coef(N,i)*coef(N,j)

                ans %= MOD

            

    print(ans)

    

if __name__ == "__main__":

    main()

import sys

input = sys.stdin.buffer.readline
import copy


def main():
    N, A, B, K = list(map(int, input().split()))
    MOD = 998244353
    fac = [0 for _ in range(N + 1)]
    fac[0], fac[1] = 1, 1
    inv = copy.deepcopy(fac)
    invfac = copy.deepcopy(fac)
    for i in range(2, N + 1):
        fac[i] = (fac[i - 1] * i) % MOD
        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD
        invfac[i] = (invfac[i - 1] * inv[i]) % MOD

    def coef(x, y):
        num = ((fac[x] * invfac[y]) % MOD) * invfac[x - y] % MOD
        return num

    ans = 0
    for i in range(min(K // max(A, B), N) + 1):
        rest = K - i * max(A, B)
        if rest % min(A, B) == 0:
            j = rest // min(A, B)
            if j <= N:
                ans += coef(N, i) * coef(N, j)
                ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.buffer.readline
import copy


def main():
    N, A, B, K = list(map(int, input().split()))
    MOD = 998244353
    fac = [0 for _ in range(N + 1)]
    fac[0], fac[1] = 1, 1
    invfac = copy.deepcopy(fac)
    for i in range(2, N + 1):
        fac[i] = (fac[i - 1] * i) % MOD
    invfac[-1] = pow(fac[-1], MOD - 2, MOD)
    for i in range(N, 0, -1):
        invfac[i - 1] = (invfac[i] * i) % MOD

    def coef(x, y):
        num = ((fac[x] * invfac[y]) % MOD) * invfac[x - y] % MOD
        return num

    ans = 0
    for i in range(min(K // max(A, B), N) + 1):
        rest = K - i * max(A, B)
        if rest % min(A, B) == 0:
            j = rest // min(A, B)
            if j <= N:
                ans += coef(N, i) * coef(N, j)
                ans %= MOD
    print(ans)


if __name__ == "__main__":
    main()

-    inv = copy.deepcopy(fac) -        inv[i] = MOD - (MOD // i) * inv[MOD % i] % MOD -        invfac[i] = (invfac[i - 1] * inv[i]) % MOD +    invfac[-1] = pow(fac[-1], MOD - 2, MOD) +    for i in range(N, 0, -1): +        invfac[i - 1] = (invfac[i] * i) % MOD