Scanf.scanf "%d %d %d %d" (fun n a b k ->
    let extgcd x y =
        let rec eg r0 r1 a0 a1 b0 b1 =
            if r1 = 0 then a0 else
                let q1 = r0 / r1 in
                eg r1 (r0 mod r1) a1 (a0 - q1 * a1) b1 (b0 - q1 * b1)
        in
        eg x y 1 0 0 1
    in
    let inv x y = (* 1/x in mod y *)
        let c = extgcd x y in
        if c < 0 then c + y else c
    in
    let z = 998244353 in
    let ( +@) a b = (a + b) mod z in
    let ( *@) a b = (a * b) mod z in
    let ( /@) a b = a *@ inv b z in
    let fact = Array.make 300001 1 in
    for i = 1 to 300000 do fact.(i) <- fact.(i - 1) *@ i done;
    let binomial n k = fact.(n) /@ (fact.(k) *@ fact.(n - k)) in
    let rec loop b0 acc =
        if b0 * b > k || b0 > n then acc else
            let r = k - b0 * b in
            if r mod a <> 0 then loop (b0 + 1) acc else
                let a0 = r / a in
                if a0 > n then loop (b0 + 1) acc else
                    let acc = acc +@ binomial n a0 *@ binomial n b0 in
                    loop (b0 + 1) acc
    in
    loop 0 0 |> Printf.printf "%d\n"
)