#include <bits/stdc++.h>
using namespace std;
char buf[1 << 21], *p1 = buf, *p2 = buf;
int read() {
  char ch;
  int res, f = 1;
  while ((ch = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin),
                             p1 == p2)
                    ? EOF
                    : *p1++)) > '9' ||
         ch < '0')
    (ch == '-') && (f = -1);
  for (res = ch - '0';
       (ch = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin),
                          p1 == p2)
                  ? EOF
                  : *p1++)) >= '0' &&
       ch <= '9';
       res = res * 10 + ch - '0')
    ;
  return res * f;
}
const int N = 100005;
double f[N][111], ans;
int n, q, a[N], b[N];
double C(int n, int m) {
  if (n < m) return 0;
  double res = 1;
  for (int i = 1; i <= m; ++i) res *= 1.0 * (n - i + 1) / i;
  return res;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = b[i] = read();
  for (int i = 1; i <= n; ++i) f[i][a[i]] = 1;
  for (int i = 1; i <= n; ++i) ans += f[i][0];
  q = read();
  for (int i = 1; i <= q; ++i) {
    int u = read(), v = read(), K = read();
    ans -= f[u][0];
    for (int j = 0; j <= a[u]; ++j) {
      double g = 0, tt = C(b[u], K);
      for (int k = 0; k <= K; ++k)
        g += f[u][j + k] * C(j + k, k) * C(b[u] - j - k, K - k) / tt;
      f[u][j] = g;
    }
    b[u] -= K, b[v] += K;
    ans += f[u][0];
    printf("%.10lf\n", ans);
  }
  return 0;
}
