#include <bits/stdc++.h>
int n, q;
double p[100100][103], s, ans;
int a[100100], cnt[100100];
int main() {
  int i, u, v, k, kk;
  scanf("%d", &n);
  for (i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    p[i][a[i]] = 1.0;
    cnt[i] = a[i];
    if (cnt[i] == 0) ans += 1.0;
  }
  for (scanf("%d", &q); q; --q) {
    scanf("%d%d%d", &u, &v, &k);
    for (kk = k; k; --k) {
      for (i = 1; i <= a[u]; ++i) {
        s = i;
        s /= cnt[u];
        p[u][i - 1] += p[u][i] * s;
        if (i == 1) ans += p[u][i] * s;
        p[u][i] *= (1.0 - s);
      }
      --cnt[u];
    }
    cnt[v] += kk;
    printf("%.10lf\n", ans);
  }
  return 0;
}
