#P6295. 有标号 DAG 计数

有标号 DAG 计数

Description

Count the number of labeled directed acyclic graphs (DAGs) on nn vertices with the requirement that the graph is weakly connected (that is, after replacing all directed edges with undirected edges, the resulting graph is connected). Output the answer modulo 998244353998244353.

Input Format

An integer TT.

Output Format

There are TT lines. On the ii-th line (1iT)(1\le i\le T), output the answer when n=in=i.

5
1
2
18
446
26430

Hint

The first test point has T=2000T = 2000.

The second test point has T=100000T = 100000.

Translated by ChatGPT 5