#include <bits/stdc++.h>
using namespace std;
double pro[100100][110];
int a[100100], b[100100];
double Calc(int a, int b, int u, int v, double &p) {
  int i;
  if (u > a || u - v > a - b || v > b) return -1;
  if (u - v <= a - b && p < 0) {
    p = 1;
    for (i = 0; i < v; i++) p = p * (b - i) / (i + 1);
    for (i = 0; i < u - v; i++) p = p * (a - b - i) / (i + 1);
    for (i = 0; i < u; i++) p = p / (a - i) * (i + 1);
    return p;
  } else {
    p = p * (b - v + 1) / v;
    p = p / (a - b - u + v) * (u - v + 1);
    return p;
  }
}
int main() {
  int N, Q, u, v, k, i, j;
  double res, x, p;
  scanf("%d", &N);
  for (res = i = 0; i < N; i++) {
    scanf("%d", a + i);
    pro[i][a[i]] = 1;
    b[i] = a[i];
    if (a[i] == 0) res++;
  }
  for (scanf("%d", &Q); Q--;) {
    scanf("%d%d%d", &u, &v, &k);
    u--;
    v--;
    res -= pro[u][0];
    for (i = 1; i <= b[u] && i <= a[u]; i++) {
      if (pro[u][i] < 1e-12) continue;
      x = pro[u][i];
      pro[u][i] = 0;
      p = -1;
      for (j = 0; j <= i && j <= k; j++) {
        pro[u][i - j] += x * max(0.0, Calc(a[u], i, k, j, p));
      }
    }
    res += pro[u][0];
    a[u] -= k;
    a[v] += k;
    printf("%.10lf\n", res);
  }
  return 0;
}
