#include #include #include using namespace std; int main() { int t,n,a[500]; scanf("%d",&t); int i,j; int t1,t2; while(t--) { t1=0; scanf("%d",&n); t2=n*(n-1); memset(a,0,sizeof(a)); for(i=0;ia[j]) t1++; } double a,b,ans; a=(double)t1; b=(double)t2; ans=a/b; if(ans==-0.0) ans=0.0; printf("%.6lf\n",ans); } return 0; }