#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000, MAXA = 100;
int cnt[MAXN + 10];
double pr[MAXN + 10][MAXA + 5], tmp[MAXA + 5];
double bi[MAXN + 10][6];
inline double binom(int n, int k) {
  assert(k <= 5);
  if (n < k || k < 0) {
    return 0.0;
  }
  return bi[n][k];
}
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n); ++i) {
    int a;
    scanf("%d", &a);
    cnt[i] = a;
    pr[i][a] = 1.0;
  }
  bi[0][0] = 1.0;
  for (int i = 1; i <= MAXN; ++i) {
    bi[i][0] = 1.0;
    if (i <= 5) {
      bi[i][i] = 1.0;
    }
    for (int j = 1; j < min(i, 6); ++j) {
      bi[i][j] = bi[i - 1][j] + bi[i - 1][j - 1];
    }
  }
  int Q;
  scanf("%d", &Q);
  double res = 0.0;
  for (int i = 0; i < (n); ++i) {
    res += pr[i][0];
  }
  for (int i = 0; i < (Q); ++i) {
    int u, v, K;
    scanf("%d%d%d", &u, &v, &K);
    --u;
    --v;
    res -= pr[u][0];
    for (int j = 0; j <= MAXA; ++j) {
      tmp[j] = 0.0;
    }
    for (int j = 0; j <= min(MAXA, cnt[u]); ++j) {
      double p = pr[u][j] / binom(cnt[u], K);
      for (int k = 0; k <= min(j, K); ++k) {
        tmp[j - k] += binom(j, k) * binom(cnt[u] - j, K - k) * p;
      }
    }
    cnt[u] -= K;
    cnt[v] += K;
    for (int j = 0; j <= MAXA; ++j) {
      pr[u][j] = tmp[j];
    }
    res += pr[u][0];
    printf("%.10lf\n", res);
  }
  return 0;
}
