##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
You are given an integer .
Consider a permutation of .
A contiguous segment is called consecutive increasing if for every .
The value of a permutation is the maximum length of a consecutive increasing segment in it.
For every from to , find the number of permutations of value exactly . Output each answer modulo .
Here, is the number of permutations whose value is exactly , taken modulo .
The only permutation is , and its value is .
The permutations and have values and , respectively.
Among the six permutations, three have value , two have value , and only has value .
For example, has value . Only has value .