Case Two Prints Zero

This program counts connected components for each of t independent test cases:

const int N = 100005;
vector<int> adj[N];
bool seen[N];

void dfs(int u) {
  seen[u] = true;
  for (int v : adj[u]) if (!seen[v]) dfs(v);
}

int main() {
  int t; cin >> t;
  while (t--) {
    int n, m; cin >> n >> m;
    for (int i = 0; i < m; i++) {
      int u, v; cin >> u >> v;
      adj[u].push_back(v);
      adj[v].push_back(u);
    }
    int comps = 0;
    for (int i = 1; i <= n; i++) if (!seen[i]) { comps++; dfs(i); }
    cout << comps << "\n";
  }
}

Input:

2
3 1
1 2
3 0

The correct output is 2 then 3. What does this program print?

A

2 then 1

B

2 then 0

C

2 then 3

D

2 then 2