#include <bits/stdc++.h>
using namespace std;
double f[110000][105];
int up[110000], size[110000];
int n, q;
double ans;
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (int)n; i++) {
    scanf("%d", &up[i]);
    size[i] = up[i];
    f[i][up[i]] = 1;
    if (!up[i]) ans++;
  }
  scanf("%d", &q);
  while (q--) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    ans -= f[u][0];
    int tmp = k;
    while (k--) {
      for (int l = (1); l <= (int)up[u]; l++) {
        f[u][l - 1] += f[u][l] * (l * 1. / size[u]);
        f[u][l] *= 1. * ((size[u] - l) * 1. / size[u]);
      }
      size[u]--;
    }
    ans += f[u][0];
    size[v] += tmp;
    printf("%.11lf\n", ans);
  }
  return 0;
}
