#include <bits/stdc++.h>
#pragma GCC target("avx")
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
#pragma GCC optimize(3, "Ofast", "inline")
using namespace std;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int n, a[100005], q, siz[100005], fac[100005];
double f[100005][303], ans, g[505];
double C(int n, int m) {
  if (!n) return 1.0;
  if (!m) return 1.0;
  double res = 1.0;
  for (int i = m; i >= m - n + 1; i--) res *= i;
  return res / fac[n];
}
inline void del(int id, int x) {
  ans -= f[id][0];
  for (int i = 0; i <= x; i++) {
    for (int j = 0; j <= a[id] && j + x <= siz[id]; j++) {
      double pro = C(i, i + j) * C(x - i, siz[id] - (j + i)) / C(x, siz[id]);
      g[j] += f[id][j + i] * pro;
    }
  }
  for (int i = 0; i <= siz[id]; i++) {
    f[id][i] = g[i];
    g[i] = 0;
  }
  ans += f[id][0];
  siz[id] -= x;
}
void add(int id, int x) { siz[id] += x; }
signed main() {
  n = read();
  for (int i = 1; i <= n; i++) {
    siz[i] = a[i] = read();
    f[i][a[i]] = 1.0;
  }
  fac[0] = 1;
  for (int i = 1; i <= 10; i++) fac[i] = fac[i - 1] * i;
  q = read();
  ans = 0.0;
  for (int i = 1; i <= n; i++) ans += f[i][0];
  while (q--) {
    int x = read(), y = read(), z = read();
    del(x, z);
    add(y, z);
    printf("%.12lf\n", ans);
  }
  return 0;
}
