open Batteries
open Enum

let the_mod = 998244353
let ( *@ ) a b = a * b mod the_mod
let rec mod_pow a n =
  if n <= 0 then 1
  else if n mod 2 = 1 then a *@ mod_pow a (n-1)
  else let h = mod_pow a (n/2) in h *@ h
let mod_inv a = mod_pow a (the_mod-2)

let n, a, b, k = Scanf.scanf "%d %d %d %d" (fun w x y z -> w, x, y, z)

let combs =
  let res = Array.make 101010 0 in
  res.(0) <- 1;
  for i = 1 to 101009 do
    res.(i) <- res.(i-1) *@ (n+1-i) *@ mod_inv i
  done;
  res

let () =
  (0--n) |> Enum.fold (fun sum r ->
    let rest = k - a * r in
    if rest mod b = 0 && rest / b <= n then
      let c = combs.(r) *@ combs.(rest / b) in
      sum + c
    else
      sum) 0
  |> Printf.printf "%d\n"
