960_G. Bandit Blues

Japate, while traveling through the forest of Mala, saw N bags of gold lying in a row. Each bag has some distinct weight of gold between 1 to N. Japate can carry only one bag of gold with him, so he uses the following strategy to choose a bag.

Initially, he starts with an empty bag (zero weight). He considers the bags in some order. If the current bag has a higher weight than the bag in his hand, he picks the current bag.

Japate put the bags in some order. Japate realizes that he will pick A bags, if he starts picking bags from the front, and will pick B bags, if he starts picking bags from the back. By picking we mean replacing the bag in his hand with the current one.

Now he wonders how many permutations of bags are possible, in which he picks A bags from the front and B bags from back using the above strategy.

Since the answer can be very large, output it modulo 998244353.

Input

The only line of input contains three space separated integers N (1 ≤ N ≤ 105), A and B (0 ≤ A, B ≤ N).

Output

Output a single integer — the number of valid permutations modulo 998244353.

Examples

Input

1 1 1


Output

1

Input

2 1 1


Output

0

Input

2 2 1


Output

1

Input

5 2 2


Output

22

Note

In sample case 1, the only possible permutation is [1]

In sample cases 2 and 3, only two permutations of size 2 are possible:{[1, 2], [2, 1]}. The values of a and b for first permutation is 2 and 1, and for the second permutation these values are 1 and 2. 

In sample case 4, out of 120 permutations of [1, 2, 3, 4, 5] possible, only 22 satisfy the given constraints of a and b.

Example input:
5 2 2

2 1 1

1 1 1

2 2 1


Example output:
22

0

1

1


Tags: combinatorics
dp
fft
math
Difficulty rating: 2900

Solution:
#include <bits/stdc++.h>
using namespace std;
const long long lg = 18, N = 1 << lg, mod = 998244353;
int n, a, b;
long long fac[N], ifa[N], rev[N], w[N], c[N], d[N];
long long po(long long a, long long b) {
  long long r = 1;
  for (; b; b >>= 1, (a *= a) %= mod)
    if (b & 1) (r *= a) %= mod;
  return r;
}
void FFT(long long *a, int lg) {
  for (int i = 0; i < (1 << lg); i++)
    if (i < rev[i]) swap(a[i], a[rev[i]]);
  for (int i = 0; i < lg; i++)
    for (int j = 0; j < (1 << lg); j++)
      if (j & 1 << i) {
        long long x = j ^ 1 << i, l = a[x],
                  r = a[j] * w[(j & (1 << i) - 1) << lg - 1 - i] % mod;
        a[x] = (l + r) % mod, a[j] = (l + mod - r) % mod;
      }
}
vector<long long> work(int l, int r) {
  if (l + 1 == r) return {l, 1};
  int mid = l + r >> 1, _lg, n;
  vector<long long> a = work(l, mid), b = work(mid, r);
  for (_lg = 0; 1 << _lg < r - l + 1; _lg++)
    ;
  n = 1 << _lg;
  for (int i = 0; i < n; i++)
    c[i] = d[i] = 0, w[i] = po(3, 1ll * (mod - 1) * i / n),
    rev[i] = rev[i / 2] / 2 | (i & 1) << _lg - 1;
  for (int i = 0; i <= mid - l; i++) c[i] = a[i];
  for (int i = 0; i <= r - mid; i++) d[i] = b[i];
  FFT(c, _lg), FFT(d, _lg);
  for (int i = 0; i < n; i++) (c[i] *= d[i]) %= mod, w[i] = po(w[i], mod - 2);
  FFT(c, _lg);
  vector<long long> res;
  for (int i = 0; i <= r - l; i++)
    res.push_back((c[i] * po(n, mod - 2) % mod + mod) % mod);
  return res;
}
int main() {
  scanf("%d%d%d", &n, &a, &b);
  if (!a || !b || a + b > n + 1) {
    puts("0");
    return 0;
  }
  if (n == 1) {
    puts("1");
    return 0;
  }
  n--, a--, b--;
  fac[0] = ifa[0] = 1;
  for (int i = 1; i < N; i++)
    ifa[i] = po(fac[i] = fac[i - 1] * i % mod, mod - 2);
  vector<long long> r = work(0, n);
  printf("%lld\n", r[a + b] * fac[a + b] % mod * ifa[a] % mod * ifa[b] % mod);
  return 0;
}