#include <bits/stdc++.h>
using namespace std;
int n;
int x[100005];
double f[100005][105], f2[105], r;
double c(int n, int k) {
  double d = 1;
  for (int i = 0, ThxDem = k; i < ThxDem; ++i) d *= 1. * (n - i) / (i + 1);
  return d;
}
int main() {
  scanf("%d", &n);
  for (int i = 0, ThxDem = n; i < ThxDem; ++i)
    scanf("%d", x + i), f[i][x[i]] = 1.;
  for (int i = 0, ThxDem = n; i < ThxDem; ++i) r += f[i][0];
  int q;
  scanf("%d", &q);
  while (q--) {
    int a, b, k;
    scanf("%d%d%d", &a, &b, &k);
    a--;
    b--;
    r -= f[a][0];
    fill(f2, f2 + 105, 0.);
    double d = c(x[a], k);
    for (int j = 0, ThxDem = k + 1; j < ThxDem; ++j) {
      double c0 = 1., c1 = c(x[a] - j, k - j);
      for (int i = j, ThxDem = min(100, x[a]) + 1; i < ThxDem; ++i) {
        f2[i - j] += f[a][i] * c0 * c1 / d;
        c0 *= 1. * (i + 1) / (i + 1 - j);
        c1 *= 1. * (x[a] - i - (k - j)) / (x[a] - i);
      }
    }
    memcpy(f[a], f2, sizeof(f[a]));
    r += f[a][0];
    printf("%.12lf\n", r);
    x[a] -= k;
    x[b] += k;
  }
  return 0;
}
