##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
| # | Title | Points | Solved | Admin | |
|---|---|---|---|---|---|
For a permutation of integers from to , define an array of length as follows.
Initially, all elements of are equal to .
For each adjacent pair , let and . Then, for every with , increase by .
You are given . Find the number of different arrays that can be obtained from at least one permutation of .
Output the answer modulo .
The array has length , so there is only one possible array: the empty array.
The only possible array is .
The possible arrays are , , and .
There are different arrays. For example, is obtained from the permutation , and is obtained from the permutation .
After removing duplicates among all permutations, different arrays remain. For example, and are both possible.