| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 | 2048 MB | 14 | 8 | 5 | 71.429% |
Busy Beaver has taken on a new engineering challenge: designing a water distribution system for his growing beaver colony. The system will consist of $N$ water stations (nodes) connected by pipes (edges), where no pipe connects a station to itself and no two stations have more than one pipe between them. As a careful planner, Busy Beaver ensures the entire system is connected; that is, water can flow from any station to any other through some series of pipes.
Busy Beaver wants his system to be resilient: no matter which spanning tree of pipes is chosen to serve as the active network, there must always be at least one main station, a node with degree at least $K$ in that tree, where $\frac{N + 3}{2} \le K < N$.
How many distinct connected pipe networks on $N$ labeled stations satisfy this condition? Two networks are considered distinct if they differ by at least one pipe. Since the answer may be enormous, output it modulo $998\,244\,353$.
The input contains two integers $N$ and $K$ ($5 \le N \le 5000$, $\frac{N + 3}{2} \le K < N$).
Output a single integer --- the number of connected graphs satisfying the condition, modulo $998\,244\,353$.
| 번호 | 배점 | 제한 |
|---|---|---|
| 1 | 10 | $N\le 7$. |
| 2 | 20 | $K \ge \max(N - 5,\frac{N + 3}{2})$. |
| 3 | 50 | $N \le 200$. |
| 4 | 20 | No additional constraints. |
7 5
322
50 28
360690501