#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 1e2;
const int MAXS = 1.1e2;
void take(double *prob, int startcnt, int &ccnt, double &ans) {
  assert(ccnt > 0);
  ans -= prob[0];
  for (int i = 0; i <= startcnt; i++) {
    double nprob = prob[i] * double(ccnt - i) / ccnt;
    if (i < startcnt) nprob += prob[i + 1] * double(i + 1) / ccnt;
    prob[i] = nprob;
  }
  ccnt--;
  ans += prob[0];
}
double prob[MAXN][MAXS + 1];
int main() {
  int n;
  while (scanf("%d", &n) >= 1) {
    vector<int> scnt(n);
    for (int i = 0; i < n; i++) scanf("%d", &scnt[i]);
    memset(prob, 0, sizeof prob);
    double ans = 0;
    for (int i = 0; i < n; i++) {
      prob[i][scnt[i]] = 1;
      if (scnt[i] == 0) ans++;
    }
    vector<int> ccnt = scnt;
    int q;
    scanf("%d", &q);
    while (q-- > 0) {
      int a, b, cnt;
      scanf("%d%d%d", &a, &b, &cnt), a--, b--;
      for (int i = 0; i < cnt; i++) take(prob[a], scnt[a], ccnt[a], ans);
      ccnt[b] += cnt;
      printf("%.18e\n", ans);
    }
  }
  return 0;
}
