## 题解

$B(x) – B(x)’ = \frac{x^{b – 1}}{(b – 1)!}$

$(B(x)^t)’ = t B(x)’ B(x)^{t – 1} = t B(x) B(x)^{t – 1} – t (B(x) – B'(x)) B(x)^{t – 1} = t(B(x)^t – \frac{B(x)^{t – 1} x^{b – 1}}{(b – 1)!})$

$$k f_{k} = t(f_{k – 1} – \frac{g_{k – b}}{(b – 1)!})$$

$$f_k = \frac{t}{k} (f_{k – 1} – \frac{g_{k – b}}{(b – 1)!})$$

## 代码

#include<bits/stdc++.h>
#define L(i, j, k) for(int i = j, i##E = k; i <= i##E; i++)
#define R(i, j, k) for(int i = j, i##E = k; i >= i##E; i--)
#define ll long long
#define ull unsigned long long
#define db double
#define pii pair<int, int>
#define mkp make_pair
#define sz(a) ((int) a.size())
using namespace std;
const int N = 254, M = N * N, mod = 998244353;
int n, a, b, f[N], dp[N][M], ans;
int fac[M], ifac[M], inv[M];
int qpow(int x, int y = mod - 2) {
int res = 1;
for(; y; x = (ll) x * x % mod, y >>= 1) if(y & 1) res = (ll) res * x % mod;
return res;
}
int C(int x, int y) {
return (ll) fac[x] * ifac[y] % mod * ifac[x - y] % mod;
}
void init(int x) {
fac[0] = ifac[0] = inv[1] = 1;
L(i, 2, x) inv[i] = (ll) inv[mod % i] * (mod - mod / i) % mod;
L(i, 1, x) fac[i] = (ll) fac[i - 1] * i % mod, ifac[i] = (ll) ifac[i - 1] * inv[i] % mod;
}
int fpow(int x) {
return x % 2 == 1 ? mod - 1 : 1;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0), cout.tie(0);
cin >> n >> a >> b, init(n * a + 1);
L(i, 0, n - 1) dp[i][0] = 1;
L(i, 1, n - 1)
L(j, 1, i * (b - 1))
dp[i][j] = (ll) i * (dp[i][j - 1] - (j >= b ? (ll) ifac[b - 1] * dp[i - 1][j - b] % mod : 0) + mod) % mod * inv[j] % mod;
L(i, 0, n - 1)
L(j, 0, i * (b - 1))
(f[i] += (ll) qpow(inv[i + 1], j + a) * ifac[a - 1] % mod * fac[a + j - 1] % mod * dp[i][j] % mod) %= mod;
L(i, 0, n - 1) f[i] = (ll) f[i] * C(n - 1, i) % mod;
L(i, 0, n - 1) (ans += (ll) f[i] * fpow(i) % mod) %= mod;
ans = (mod + 1 - ans) % mod, ans = (ll) ans * n % mod;
cout << ans << "\n";
return 0;
}


#### zhoukangyang

orz Qiuls! [cnblogs](https://www.cnblogs.com/zkyJuruo/) 怎么上传头像啊qaq