#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x=sum) return _P("%d\n",N); dp[0][0][0]=1; FOR(i,N) { FOR(x,i+1) { FOR(y,22000) if(dp[i][y][x]) { dp[i+1][min(22000,y+S[i])][x+1] += dp[i][y][x]; dp[i+1][y][x] += dp[i][y][x]; } } } double ret=0; FOR(i,N) { for(y=S[i];y<=L+S[i]-1;y++) { for(x=1;x<=N;x++) if(dp[N][y][x]) { ret += dp[N][y-S[i]][x-1] * fact[x-1] * fact[N-x]; } } } ret /= fact[N]; _P("%.12lf\n",ret); } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); solve(); return 0; }