HDU/2048-i/main.c
Saturneric 0525ffad24 Add.
2020-09-01 00:48:58 +08:00

3 lines
245 B
C

#include<stdio.h>
unsigned long long f[21],sum;int main(){int i,t,n;f[1]=0;f[2]=1;for(i=3;i<21;i++)f[i]=(i-1)*(f[i-1]+f[i-2]);scanf("%d",&t);while(t--){scanf("%d",&n);sum=1;for(i=1;i<=n;i++)sum*=i;printf("%.2lf%%\n",f[n]*100.0/sum);}return 0;}