#include <bits/stdc++.h>
using namespace std;
const int MAX = 100000 + 10;
const int NUM = 100 + 10;
const double EPS = 1e-9;
int a[MAX], n, Q;
double f[MAX][NUM], q[NUM];
double C(int a, int b) {
  int i;
  double tot = 1;
  for (i = a; i >= a - b + 1; --i) tot *= i;
  for (i = b; i >= 1; --i) tot /= i;
  return tot;
}
int main() {
  int i, u, v, t, j, k;
  scanf("%d", &n);
  double now = 0;
  for (i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    f[i][a[i]] = 1.0;
    if (a[i] == 0) now += 1.0;
  }
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d%d%d", &u, &v, &t);
    now -= f[u][0];
    memset(q, 0, sizeof q);
    double all = C(a[u], t);
    for (j = 0; j < NUM; ++j)
      if (j <= a[u]) {
        for (k = 0; k <= t && j >= k; ++k)
          q[j - k] += f[u][j] * C(j, k) * C(a[u] - j, t - k) / all;
      }
    for (j = 0; j < NUM; ++j) f[u][j] = q[j];
    a[u] -= t;
    a[v] += t;
    now += f[u][0];
    printf("%.9lf\n", now);
  }
  return 0;
}
