#include <bits/stdc++.h>
const int N = (int)1e5 + 5, A = 105;
int n, q, a[N], cnt[N];
double ans, f[N][A];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    cnt[i] = a[i];
    f[i][a[i]] = 1;
    ans += f[i][0];
  }
  scanf("%d", &q);
  while (q--) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    ans -= f[u][0];
    for (int i = 0; i < k; i++) {
      for (int j = 1; j <= a[u] && j <= cnt[u]; j++) {
        f[u][j - 1] += f[u][j] * j / cnt[u];
        f[u][j] *= 1. * (cnt[u] - j) / cnt[u];
      }
      cnt[u]--;
    }
    cnt[v] += k;
    ans += f[u][0];
    printf("%.12lf\n", ans);
  }
}
