#include <bits/stdc++.h>
using namespace std;
int n, a[100010], b[100010];
double f[100010][110], g[110];
int q;
double C(int j, int i) {
  double ret = 1;
  for (int k = 1; k <= j; k++) ret *= (i - k + 1);
  for (int k = 1; k <= j; k++) ret /= k;
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i];
    for (int j = 0; j <= 100; j++) f[i][j] = 0;
    f[i][a[i]] = 1;
  }
  scanf("%d", &q);
  double ans = 0;
  for (int i = 1; i <= n; i++) ans += f[i][0];
  while (q--) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    if (k > a[u])
      while (1)
        ;
    for (int i = 0; i <= b[u]; i++) {
      g[i] = f[u][i];
      f[u][i] = 0;
    }
    for (int i = 0; i <= b[u] && i <= a[u]; i++) {
      for (int j = 0; j <= k && i >= j; j++)
        if (a[u] - i >= k - j) {
          f[u][i - j] += g[i] * C(j, i) * C(k - j, a[u] - i) / C(k, a[u]);
        }
    }
    ans -= g[0];
    ans += f[u][0];
    a[u] -= k;
    b[u] = min(a[u], b[u]);
    a[v] += k;
    printf("%.10f\n", ans);
  }
}
