Camp room assignment
Time limit3sMemory limit1024 MB
For each n from 1 to m, count the length-2n sequences over m universities in which no university appears more than n times.
- Level
Medium6 of 10
- Topics
- Combinatorics, Math
- Solved
- No attempts yet
Problem
In the JAG country, there are a total of universities, and we plan to invite students to a training camp. Each student is affiliated with one of the universities. During the camp, the students will be accommodated in twin rooms, so each room is assigned exactly two students.
A room assignment is good if and only if the two students sharing each room come from different universities.
We want to know how often a good room assignment is feasible. There are possible sequences of university affiliations. Find how many of them admit a good room assignment.
We do not yet know how many rooms we can provide. Therefore, for each , find how many sequences of university affiliations admit a good room assignment.
Since the answer may be huge, print the answers modulo .
Input
The input is a single line containing an integer between and , inclusive.
Output
Output lines. On the -th line, output the answer for .