#include <bits/stdc++.h>
int n, a[100001], b[100001], Q, u, v, k, i, tmp, j;
double dp[100001][102], now;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i];
    dp[i][a[i]] = 1;
    now += dp[i][0];
  }
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d%d%d", &u, &v, &k);
    now -= dp[u][0];
    for (i = 1, tmp = a[u]; i <= k; i++, --tmp)
      for (j = 0; j <= b[u]; j++)
        dp[u][j] = dp[u][j] * (tmp - j) / tmp + dp[u][j + 1] * (j + 1) / tmp;
    now += dp[u][0];
    a[u] -= k;
    a[v] += k;
    printf("%.12lf\n", now);
  }
}
