#include <bits/stdc++.h>
const int N = 100009;
double f[N][111], ans;
int n, a[N], q, Max[N];
void read(int &x) {
  char c = getchar();
  for (; c < '0' || c > '9'; c = getchar())
    ;
  for (x = 0; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
}
int main() {
  read(n);
  for (int i = 1; i <= n; ++i) {
    read(a[i]);
    f[i][a[i]] = 1;
    Max[i] = a[i];
    if (!a[i]) ans += 1;
  }
  read(q);
  for (int u, v, k; q--;) {
    read(u);
    read(v);
    read(k);
    double *F = f[u];
    ans -= F[0];
    for (int i = 0; i <= Max[u]; ++i) {
      double sum = 0, p = 1;
      if (i + k > a[u]) {
        F[i] = 0;
        continue;
      }
      for (int j = 0; j < k; ++j) p = p * (a[u] - i - j) / (a[u] - j);
      for (int j = 0; j <= k; ++j) {
        sum += F[i + j] * p;
        p = p * (j + i + 1) / (j + 1) / (a[u] - i - j) * (k - j);
      }
      F[i] = sum;
    }
    a[v] += k;
    a[u] -= k;
    ans += F[0];
    printf("%.10f\n", ans);
  }
}
