Clean Sequence (Easy)
InterviewTime limit1sMemory limit1024 MB
Count the clean sequences of length 2N whose score is minimal, where N is at most 10.
- Level
Easy3 of 10
- Topics
- Math, Combinatorics
- Solved
- No attempts yet
Problem
A clean sequence is a sequence of length in which each integer from to appears exactly twice.
The score of a clean sequence is the sum, over every integer from to , of the following value.
- (sum of the numbers between the two s) ×
Here, "between" includes the two endpoint s.
Count the clean sequences of length whose score is minimal.
Input
The first line contains an integer ().
Output
On the first line, print the number of clean sequences of length whose score is minimal.
Hint
For example, is a clean sequence with . Its score is calculated as follows, giving 50 points.
The numbers between the two s are , so is added to the score.
The numbers between the two s are , so is added.
The numbers between the two s are , so is added.
The score of this sequence is , which is 50. This sequence does not have the minimum score among clean sequences with .