Series Sum
Time limit2sMemory limit2048 MB
Given k and p, compute the infinite sum of C(n, k)^p / 2^n for n from k to infinity, modulo 998244353.
- Level
Hard8 of 10
- Topics
- Math, Combinatorics, Dynamic programming
- Solved
- No attempts yet
Problem
Given two integers and , calculate the following value.
Here is the binomial coefficient, equal to .
The result can be written as , where and are positive coprime integers and . Output modulo 998244353.
Input
The first line contains an integer (), the number of test cases. Each test case is one line with two integers and (, ). The sum of over all test cases does not exceed .
Output
For each test case, print on a single line the value .