#include <bits/stdc++.h>
using namespace std;
double p[100001][102] = {}, ans = 0;
int n, q, a[100001], u, v, k;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    p[i][a[i]] = 1.0;
    ans += p[i][0];
  }
  scanf("%d", &q);
  for (int i = 0; i < q; ++i) {
    scanf("%d%d%d", &u, &v, &k);
    ans -= p[u][0];
    for (int j = 0; j < k; ++j) {
      for (int c = 0; c <= 100; ++c)
        if (c <= a[u])
          p[u][c] = p[u][c] * (a[u] - c) / a[u] + p[u][c + 1] * (c + 1) / a[u];
        else
          p[u][c] = 0.0;
      a[u]--;
    }
    a[v] += k;
    ans += p[u][0];
    printf("%0.12lf\n", ans);
  }
  return 0;
}
