#include <bits/stdc++.h>
using namespace std;
int sum[100010];
double dp[100010][110];
double c(int x, int y) {
  if (x < y) return 0;
  if (y == 0) return 1.0;
  double tmp = 1.0;
  while (y > 0) {
    tmp *= 1.0 * x;
    tmp /= 1.0 * y;
    x--;
    y--;
  }
  return tmp;
}
double mark[110];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &sum[i]);
  memset(dp, 0, sizeof(dp));
  double ans = 0;
  for (int i = 1; i <= n; i++) {
    dp[i][sum[i]] = 1.0;
    if (sum[i] == 0) ans += 1.0;
  }
  int Q;
  scanf("%d", &Q);
  while (Q--) {
    int x, y, s;
    scanf("%d %d %d", &x, &y, &s);
    ans -= dp[x][0];
    memset(mark, 0, sizeof(mark));
    for (int i = 0; i < 110; i++) {
      if (dp[x][i] == 0) continue;
      int j = sum[x] - i;
      for (int k = 0; k <= s; k++) {
        int ai = k;
        int aj = s - k;
        if (ai > i || aj > j) continue;
        double p = c(i, ai) * c(j, aj) / c(sum[x], s);
        p *= dp[x][i];
        mark[i - ai] += p;
      }
    }
    for (int i = 0; i < 110; i++) dp[x][i] = mark[i];
    ans += dp[x][0];
    sum[x] -= s;
    sum[y] += s;
    printf("%.12f\n", ans);
  }
  return 0;
}
