#include <cassert> #include <iostream> #include <unordered_map> #include <vector> #include <bits/stdc++.h> using namespace std; struct DSU { vector<int> fa, sz; int component; DSU(int n, int type = 0) : fa(n + type), sz(n + type, 1) { iota(fa.begin(), fa.end(), 0)...