#include <bits/stdc++.h>
int n, a[100010], init[100010];
double dp[100010][101];
double tmp[101];
double C(int x, int y) {
  if (x < y) return 0;
  double res = 1;
  for (int i = 0; i < y; i++) res = res * (x - i) / (i + 1);
  return res;
}
int main() {
  int q, x, y, z;
  scanf("%d", &n);
  double res = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    dp[i][a[i]] = 1;
    init[i] = a[i];
    if (a[i] == 0) res += 1;
  }
  for (scanf("%d", &q); q--;) {
    scanf("%d%d%d", &x, &y, &z);
    res -= dp[x][0];
    memset(tmp, 0, sizeof(tmp));
    double den = C(a[x], z);
    for (int i = 0; i <= init[x] && i <= a[x]; i++)
      for (int j = 0; j <= z && j <= i; j++)
        tmp[i - j] += dp[x][i] * (C(i, j) * C(a[x] - i, z - j) / den);
    for (int i = 0; i <= init[x]; i++) dp[x][i] = tmp[i];
    res += dp[x][0];
    a[x] -= z;
    a[y] += z;
    printf("%.12lf\n", res);
  }
  return 0;
}
