#include <bits/stdc++.h>
int n, m, a[100000];
double ans, f[100000][101], c[1000000][6];
int main() {
  for (int i = 0; i < 1000000; i++) {
    c[i][0] = 1.0;
    for (int j = 1; j < 6 && j <= i; j++)
      c[i][j] = c[i][j - 1] * (i - j + 1) / j;
  }
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    f[i][a[i]] = 1.0;
    if (!a[i]) ans += 1.0;
  }
  scanf("%d", &m);
  for (int i = 0, u, v, k; i < m; i++) {
    scanf("%d%d%d", &u, &v, &k), u--, v--;
    ans -= f[u][0];
    if (u != v) ans -= f[v][0];
    for (int j = 1; j <= 100; j++) {
      if (!f[u][j]) continue;
      double tmp = f[u][j];
      int cnt = a[u] - j;
      for (int x = 0; x <= k; x++) {
        if (x <= j && k - x <= cnt)
          f[u][j - x] += c[j][x] * c[cnt][k - x] / c[a[u]][k] * tmp;
      }
      f[u][j] -= tmp;
    }
    a[u] -= k;
    a[v] += k;
    ans += f[u][0];
    if (u != v) ans += f[v][0];
    printf("%.12lf\n", ans);
  }
  return 0;
}
