#include <bits/stdc++.h>
using namespace std;
int gi() {
  int x = 0, w = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') w = 0, ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return w ? x : -x;
}
const int N = 1e5 + 5;
int n, q, a[N], g[N];
double C[N * 5][6], f[N][105], tmp[105], ans;
int main() {
  n = gi();
  for (int i = 1; i <= n; ++i)
    a[i] = g[i] = gi(), f[i][a[i]] = 1, ans += f[i][0];
  C[0][0] = 1;
  for (int i = 1; i < N * 5; ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= i && j <= 5; ++j)
      C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
  }
  q = gi();
  while (q--) {
    int x = gi(), y = gi(), z = gi();
    ans -= f[x][0];
    memset(tmp, 0, sizeof(tmp));
    for (int i = min(a[x], g[x]); ~i; --i)
      for (int j = 0; j <= i && j <= z; ++j)
        tmp[i - j] += f[x][i] * C[i][j] * C[g[x] - i][z - j];
    for (int i = a[x]; ~i; --i) f[x][i] = tmp[i] / C[g[x]][z];
    g[x] -= z;
    g[y] += z;
    ans += f[x][0];
    printf("%.10lf\n", ans);
  }
  return 0;
}
