#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  bool t = false;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') t = true, ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
  return t ? -x : x;
}
double f[100100][111], ans;
int n, q, a[100100], b[100100];
double C(int n, int m) {
  if (n < m) return 0;
  double ret = 1;
  for (int i = 1; i <= m; ++i) ret = ret * (1.0 * (n - i + 1) / i);
  return ret;
}
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;
}
