You are given an undirected graph with $$$n$$$ vertices and $$$m$$$ edges. The vertices are numbered from $$$1$$$ to $$$n$$$. The graph contains no self-loops or multiple edges.
Your task is to make a graph directed by choosing a direction for each edge. After directing the edges, call a sequence of vertices $$$v_1, v_2, \dots, v_k$$$, where $$$k$$$ can be arbitrarily large and any vertex can be repeated any number of times, an alternating path if:
Call a vertex $$$v$$$ beautiful if all paths (not necessarily simple) in the original graph that start at vertex $$$v$$$ are alternating in the resulting directed graph.
What is the maximum number of vertices that can be made beautiful after directing the edges?
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 2 \cdot 10^5$$$; $$$0 \le m \le 2 \cdot 10^5$$$) — the number of vertices and edges in the graph, respectively.
Each of the following $$$m$$$ lines contains two integers $$$v$$$ and $$$u$$$ ($$$1 \le v, u \le n$$$) — the description of the edges of the graph.
Additional constraints on the input:
For each test case, print a single integer — the maximum number of vertices that can be made beautiful after directing the edges.
48 91 31 42 32 45 66 77 88 56 84 06 21 52 31 0
2441
| Name |
|---|


