#include <bits/stdc++.h>
using namespace std;
double C(int x, int y) {
  double ans = 1;
  for (int i = 1; i <= y; i++) {
    ans /= i;
    ans *= (x - i + 1);
  }
  return ans;
}
int N, Q;
double p[110000][110];
int a[110000];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) scanf("%d", &a[i]);
  for (int i = 0; i < N; i++) p[i][a[i]] = 1;
  double ans = 0;
  for (int i = 0; i < N; i++)
    if (a[i] == 0) ans++;
  for (scanf("%d", &Q); Q--;) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    u--, v--;
    ans -= p[u][0];
    for (int i = 0; i <= a[u] && i <= 100; i++) {
      double p0 = p[u][i];
      p[u][i] = 0;
      for (int j = 0; j <= k && j <= i; j++) {
        p[u][i - j] += p0 * C(i, j) * C(a[u] - i, k - j) / C(a[u], k);
      }
    }
    ans += p[u][0];
    a[u] -= k;
    a[v] += k;
    printf("%.10lf\n", ans);
  }
  return 0;
}
