시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 2048 MB148571.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$.

서브태스크

번호배점제한
110

$N\le 7$.

220

$K \ge \max(N - 5,\frac{N + 3}{2})$.

350

$N \le 200$.

420

No additional constraints.

예제 입력 1

7 5

예제 출력 1

322

예제 입력 2

50 28

예제 출력 2

360690501

채점 및 기타 정보

  • 예제는 채점하지 않는다.