atcoder#AGC022F. [AGC022F] Checkers
[AGC022F] Checkers
Score : points
Problem Statement
Let . Inaba has checker pieces on the number line, where the -th checker piece is at coordinate for all .
Every second, Inaba chooses two checker pieces, and , and move to the symmetric point of its current position with respect to . After that, is removed. (It is possible that and occupy the same position, and it is also possible for to occupy the same position as another checker piece after the move).
After seconds, only one checker piece will remain. Find the number of distinct possible positions of that checker piece, modulo .
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the number of distinct possible positions of the final checker piece, modulo .
3
12
There are checker pieces, positioned at respectively. Call them respectively.
Here are two (of the ) possible sequence of moves :
- Let jump over in the first second, and let jump over in the second second. The final position of is .
- Let jump over in the first second, and let jump over in the second second. The final position of is .
There are a total of possible sequence of moves, and the final piece are in different positions in all of them.
4
84
22
487772376
Remember to output your answer modulo .