缺省源
#include <bits/stdc++.h>
#define L(i, j, k) for (int i = (j); i <= (k); i++)
#define R(i, j, k) for (int i = (j); i >= (k); i--)
using namespace std;
using ll = long long;
constexpr int N = 1e5 + 10; 文件读写
#define file(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout)快读
#define getchar() (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2) ? EOF: *p1++)
char buf[1 << 21], *p1 = buf, *p2 = buf;
inline int rd() {
int x = 0, f = 1; char ch = getchar();
while (ch < '0' || ch > '9') {if (ch == '-') f = -1; ch = getchar();}
while (ch >= '0' && ch <= '9') {x = (x << 3) + (x << 1) + ch - 48; ch = getchar();}
return x * f;
}快写
void write(int x) {
if (x < 0) {
x = -x;
putchar('-');
}
if (x > 9) write(x / 10);
putchar(x % 10 + '0');
}快速幂
inline 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;
}组合数
inline void init(int n) {
fac[0] = 1;
L(i, 1, n) fac[i] = (ll) fac[i - 1] * i % mod;
ifac[n] = qpow(fac[n]);
R(i, n - 1, 0) ifac[i] = (ll) ifac[i + 1] * (i + 1) % mod;
}
inline int C(int x, int y) {
if (x < y || x < 0 || y < 0) return 0;
return (ll) fac[x] * ifac[x - y] % mod * ifac[y] % mod;
}