func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 52;   const int MAX = 1e9 + 5;   int n, a[N];   long double dp[N][N][N][N];   int p;   long double all, P[N];   long double f(int wh, int ret, int left, int whd) {     if (left == 0 && ret) return 0;     if (left == 0 && ret == 0) return 1;     if (ret < 0) return 0;     if (wh > n) return 0;     long double &r = dp[wh][ret][left][whd];     if (r != -1) return r;     if (wh == whd) return r = f(wh + 1, ret, left, whd);     return r = f(wh + 1, ret - a[wh], left - 1, whd) + f(wh + 1, ret, left, whd);   }   int main() {     scanf( %d , &n);     P[0] = 1;     for (int i = 1; i <= n; i++) P[i] = P[i - 1] * i;     for (int i = 1; i <= n; i++) scanf( %d , &a[i]);     scanf( %d , &p);     for (int A = 0; A <= N - 1; A++)       for (int B = 0; B <= N - 1; B++)         for (int C = 0; C <= N - 1; C++)           for (int D = 0; D <= N - 1; D++) dp[A][B][C][D] = -1;     for (int i = 1; i <= n; i++) {       int begin = p - a[i] + 1;       int end = p;       for (int j = begin; j <= end; j++) {         for (int k = 0; k <= n; k++) {           long double temp = f(1, j, k, i);           all += temp * P[k] / P[n] * P[n - k - 1] * k;         }       }     }     for (int i = 0; i <= p; i++) all += f(1, i, n, 0) * n;     cout << setprecision(12) << fixed << all <<   n ;     return 0;   }   