#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60000000")
using namespace std;
template <class T>
T sqr(T x) {
  return x * x;
}
double const pi = 3.1415926535897932384626433832795;
int const inf = (int)1e9;
long long const inf64 = (long long)4e18;
const string name = "c";
const int NMAX = 111111;
const int ZNMAX = 105;
int n, q, zn[NMAX];
double ept[7], p[NMAX][ZNMAX], ans, old[ZNMAX], c[5 * NMAX][7];
double calc(int x, int y, int xx, int yy) {
  if (x < xx || y < yy)
    return 0;
  else
    return c[x][xx] * c[y][yy];
}
int main() {
  for (int i = 0; i < (int)5 * NMAX; i++) {
    c[i][0] = 1;
    for (int j = 0; j < (int)6; j++)
      if (j) c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
  }
  cin >> n;
  for (int i = 0; i < (int)n; i++) cin >> zn[i];
  memset(p, 0, sizeof(p));
  for (int i = 0; i < (int)n; i++) p[i][zn[i]] = 1;
  cin >> q;
  ans = 0;
  for (int i = 0; i < (int)n; i++) ans += p[i][0];
  for (int i = 0; i < (int)q; i++) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    u--, v--;
    ans -= p[u][0];
    for (int j = 0; j < (int)ZNMAX; j++) old[j] = p[u][j];
    memset(p[u], 0, sizeof(p[u]));
    for (int j = 0; j < (int)ZNMAX; j++) {
      double sum = 0;
      for (int f = 0; f < (int)k + 1; f++)
        sum += (ept[f] = calc(j, zn[u] - j, f, k - f));
      for (int f = 0; f < (int)k + 1; f++)
        if (j >= f && sum > 1e-10) p[u][j - f] += old[j] * ept[f] / sum;
    }
    zn[u] -= k, zn[v] += k;
    ans += p[u][0];
    printf("%.12lf\n", ans);
  }
  return 0;
}
