#include <bits/stdc++.h>
int n, m, i, j, p, q, r, s, u, v, k;
int a[100001];
double dp[100001][101], buf[101], ncr[1001][1001];
double ans;
int min(int a, int b) { return a < b ? a : b; }
void init() {
  int i, j;
  ncr[0][0] = 1;
  for (i = 1; i < 1001; i++)
    for (j = 0; j <= i; j++) {
      ncr[i][j] += ncr[i - 1][j];
      if (j > 0) ncr[i][j] += ncr[i - 1][j - 1];
    }
}
int main() {
  init();
  while (scanf("%d", &n) != EOF) {
    ans = 0;
    for (i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      dp[i][a[i]] = 1;
      ans += dp[i][0];
    }
    scanf("%d", &m);
    while (m-- > 0) {
      scanf("%d%d%d", &u, &v, &k);
      s = a[u];
      memset(buf, 0, sizeof(buf));
      for (i = 0; i <= 100; i++)
        for (j = 0; j <= k && j <= i; j++)
          if (dp[u][i] > 0)
            buf[i - j] +=
                dp[u][i] * (ncr[i][j] * ncr[s - i][k - j] / ncr[s][k]);
      ans -= dp[u][0];
      memcpy(dp[u], buf, sizeof(buf));
      ans += dp[u][0];
      a[u] -= k;
      a[v] += k;
      printf("%.17lf\n", ans);
    }
  }
  return 0;
}
