Simple Math Problem
Time limit1sMemory limit2048 MB
Given positive integers m and n, compute a double sum of squared binomial products modulo 998244353 for up to 100000 test cases.
- Level
Hard8 of 10
- Topics
- Combinatorics, Math
- Solved
- No attempts yet
Problem
Given two positive integers and , compute the following value modulo 998244353:
Here, is the binomial coefficient, the number of ways to choose an unordered subset of items from a fixed set of items.
Input
The first line contains one integer (), the number of test cases. Each test case is a single line containing two integers and ().
Output
For each test case, output one line containing the value of the formula modulo 998244353.