#include <bits/stdc++.h>
using namespace std;
int n, q;
double p[100010][105];
int num[100010];
int ori[100010];
double tmp[105];
double C[600010][6];
double cal(int N, int M, int r, int k) {
  double res = 1.0;
  res = res * C[M][r] * C[N - M][k - r] / C[N][k];
  return res;
}
int main() {
  double ans = 0;
  C[0][0] = 1;
  for (int i = 1; i <= 600000; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= 5; j++) C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
  }
  memset(p, 0, sizeof(p));
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &num[i]);
    ori[i] = num[i];
    p[i][num[i]] = 1.0;
    if (num[i] == 0) ans = ans + 1;
  }
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    ans -= p[u][0];
    for (int j = 0; j <= 100; j++) tmp[j] = 0;
    for (int j = 0; j <= 100; j++)
      for (int r = 0; r <= k; r++) {
        if (r > j || k - r > num[u] - j) continue;
        tmp[j - r] = tmp[j - r] + p[u][j] * cal(num[u], j, r, k);
      }
    for (int j = 0; j <= 100; j++) p[u][j] = tmp[j];
    num[u] -= k;
    num[v] += k;
    ans += p[u][0];
    printf("%.9f\n", ans);
  }
  return 0;
}
