func_code_string: #include <bits/stdc++.h>   using namespace std;   inline long long bip(long long x, long long n, long long mod) {     long long res = 1;     while (n) {       if (n & 1) {         res = (res * x) % mod;       }       x = (x * x) % mod;       n >>= 1;     }     return res;   }   const int maxn = 1e9;   const long long inf = 1e18;   const int mod = 1e9 + 7;   const int N = 1e3 + 10;   int n, m, a[1010], ind;   long long C[10][10];   void Cnk() {     for (int i = 1; i < 10; i++) {       C[i][0] = C[i][i] = 1;       for (int j = 1; j < i; j++) {         C[i][j] = C[i - 1][j - 1] + C[i - 1][j];       }     }   }   void solve() {     cin >> n >> m >> ind;     for (int i = 1; i <= m; i++) cin >> a[i];     n--, a[ind]--;     int sum = 0;     for (int i = 1; i <= m; i++) sum += a[i];     if (sum < n) {       cout << -1;       return;     }     if (a[ind] == 0) {       cout << 0.00000;       return;     }     int k = sum - a[ind], l = sum, x = l - n, y = k - n;     if (y < 0) {       cout << 1.00000000;       return;     }     long double up = 1, down = 1;     for (int i = k - n + 1; i <= l - n; i++) up *= (i + 0.0);     for (int i = k + 1; i <= l; i++) down *= (i + 0.0);     cout << 1.0000000000 - up / down;   }   int main() {     ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);     int tt = 1;     cout << fixed << setprecision(9);     while (tt--) {       solve();       cout <<   n ;     }   }   