Sum of Intersection Sizes
Time limit4sMemory limit1024 MB
Given N integer intervals, find for each k the sum of intersection sizes over all k-subsets of intervals, modulo 998244353.
- Level
Medium6 of 10
- Topics
- Combinatorics, Sorting, Math
- Solved
- No attempts yet
Problem
You are given sets . Each is the set of all integers from to , inclusive.
For each , choose of the sets and take the size of their intersection. is the sum of these intersection sizes over all ways to make the choice. In formula form:
For every , find modulo 998244353. 998244353 is a prime.
Input
The first line contains an integer . ()
Each of the next lines contains two integers and , separated by a space, which describe . ()
Output
Print lines. For every , print modulo 998244353 on the -th line.