#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100004;
double C[104][104];
int a[MAXN];
double pro[MAXN][104];
double tpro[2][10];
int main() {
  int i, j, k;
  int n, q;
  double ans;
  cout << fixed << setprecision(15);
  while (scanf("%d", &n) == 1) {
    ans = 0.;
    for (i = 0; i < n; i++) {
      for (j = 0; j <= 100; j++) pro[i][j] = 0.;
      scanf("%d", &a[i]);
      pro[i][a[i]] = 1.;
      if (a[i] == 0) ans += 1.;
    }
    scanf("%d", &q);
    while (q--) {
      int u, v, K;
      scanf("%d%d%d", &u, &v, &K);
      u--;
      v--;
      ans -= pro[u][0];
      for (i = 0; i <= 100; i++) {
        tpro[0][0] = tpro[1][0] = 1.;
        double tot = 1.;
        for (j = 1; j <= K; j++) {
          tpro[0][j] = tpro[0][j - 1] * (i + 1 - j) / j;
          tpro[1][j] = tpro[1][j - 1] * (a[u] - i + 1 - j) / j;
          tot = tot * (a[u] + 1 - j) / j;
        }
        for (j = 1; j <= K && j <= i; j++)
          pro[u][i - j] += pro[u][i] * tpro[0][j] * tpro[1][K - j] / tot;
        j = 0;
        pro[u][i - j] = pro[u][i] * tpro[0][j] * tpro[1][K - j] / tot;
      }
      ans += pro[u][0];
      a[u] -= K;
      a[v] += K;
      cout << ans << endl;
    }
  }
  return 0;
}
