题目描述
You are given an integer $M$ and $N$ pairs of integers $(A_1, B_1), (A_2, B_2), \dots, (A_N, B_N)$.
For all $i$, it holds that $1 \leq A_i \lt B_i \leq M$.
A sequence $S$ is said to be a **good sequence** if the following conditions are satisfied:
- $S$ is a contiguous subsequence of the sequence $(1,2,3,..., M)$.
- For all $i$, $S$ contains at least one of $A_i$ and $B_i$.
Let $f(k)$ be the number of possible good sequences of length $k$.
Enumerate $f(1), f(2), \dots, f(M)$.