func_code_string: #include <bits/stdc++.h>   using namespace std;   double d[100100];   int s[1010];   int main() {     ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);     int n, m, h, sum(0);     cin >> n >> m >> h;     h--;     for (int i = 0; i < m; i++) {       cin >> s[i];       sum += s[i];     }     if (sum < n) {       cout << -1 << endl;       return 0;     }     if (s[h] == 1 || n == 1) {       cout << 0 << endl;       return 0;     }     d[0] = 1;     for (int j = 0; j < sum - s[h]; j++) {       for (int t = n - 1; t >= 0; t--) {         double p1 = (double)(n - t) / (double)(sum - j - 1);         double p2 = (double)(n - t - 1) / (double)(sum - j - 1);         if (p2 <= 1)           d[t] *= (1 - p2);         else           d[t] = 0;         if (p1 <= 1 && t) d[t] += d[t - 1] * p1;       }     }     double ans(0);     for (int j = max(0, n - s[h]); j < n - 1; j++) {       ans += d[j];     }     cout << fixed << setprecision(10) << ans << endl;     return 0;   }   