#include #include #include #include using namespace std; vector G[400010],rG[400010],vis; bool used[400010]; int cmp[400010]; typedef long long ll; void add_edge(int n){ for(int i=0;i=0;i--){ if(!used[vis[i]]){ rdfs(vis[i],k); k++; } } return k; } map mp; pair p[200010]; vector z; vector dag[400010]; int mx[400010] = {},dp[400010]; bool used2[400010]; void solve(int s){ if(used2[s]) return; used2[s] = true; for(int v:dag[s]){ solve(v); dp[s] = max(dp[s],dp[v]); } } int main(){ ll i,n,m; cin >> n >> m; ll ans = n*(n + 1)/2; for(i=0;i> b >> c; mp[b] = 1; mp[c] = 1; p[i] = {b,c}; } for(auto x:mp){ ans -= x.first; z.push_back(x.first); } for(i=0;i