#543. 「Nowcoder多校 2019 Day1」ABBA
「Nowcoder多校 2019 Day1」ABBA
题目描述
Bobo has a string of length 2(n + m) which consists of characters A
and B
. The string also has a fascinating property: it can be decomposed into (n + m) subsequences of length 2, and among the (n + m) subsequences n of them are AB
while other m of them are BA
.
Given n and m, find the number of possible strings modulo .
输入格式
The input consists of several test cases and is terminated by end-of-file.
Each test case contains two integers n and m.
- There are at most 2019 test cases, and at most 20 of them has .
输出格式
For each test case, print an integer which denotes the result.
样例
样例输入
1 2
1000 1000
0 0
样例输出
13
436240410
1