#include #include #include #include #include #include #include using namespace std; int n; int fa[100005]; int siz[100005]; int ans=0; int getfa(int x) { if(fa[x]==x) return x; return fa[x]=getfa(fa[x]); } void unio(int x,int y) { siz[getfa(y)]+=siz[getfa(x)]; fa[getfa(x)]=getfa(y); } int main() { int t; cin>>t; while(t--) { cin>>n; for(int i=0;i<=n;i++) { fa[i]=i; siz[i]=1; } ans=0; for(int i=1;i