This problem has two subtasks worth
points each.
You are given an integer . You also have empty sets .
Consider all the arrays of length such that for each (there are such arrays in total).
For each of these arrays, we compute an array of length where length of longest non-decreasing subsequence for the prefix of length of array . (For example: if and , then .) Next we add the array to the set (For example, would be added to ).
Output the size of sets as space-separated integers. Since the size of the sets might be large, output the values modulo .
Note that the are sets, and hence do not contain duplicate elements. Please look at the sample cases below for an explained example.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases. The description of test cases follows.
- The first and only line of each test case contains a single integer .
Output Format
For each test case, output on a new line the space separated integers, size of sets , modulo .
Constraints
- The sum of over all tests won't exceed .
Subtasks
Subtask #1 (50 points):
- The sum of over all tests won't exceed .
Subtask #2 (50 points): Original constraints
Sample Input 1
3
2
3
4
Sample Output 1
1 1
0 2 1
0 2 3 1
Explanation
Test case :
- For ,
- For ,
- For ,
- For ,
Therefore,
Test case :
- For ,
- For ,
- For ,
- For ,
- For ,
- For ,
- For ,
- For ,
Therefore,
Test case :
No comments:
Post a Comment