#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const double eps = 1e-9;
int n, a[N], q, untasted[N];
double dp[N][101];
int main(void) {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    untasted[i] = a[i];
    dp[i][a[i]] = 1.0;
  }
  int u, v, k;
  scanf("%d", &q);
  double ans = 0;
  for (int i = 1; i <= n; ++i) ans += dp[i][0];
  for (int i = 0; i < q; ++i) {
    scanf("%d %d %d", &u, &v, &k);
    ans -= dp[u][0];
    for (int j = 0; j < k; ++j) {
      for (int x = 1; x <= untasted[u]; ++x) {
        dp[u][x - 1] += dp[u][x] * (x * 1.0 / a[u]);
        dp[u][x] = dp[u][x] * (1 - x * 1.0 / a[u]);
      }
      --a[u];
    }
    while (dp[u][untasted[u]] == 0) --untasted[u];
    a[v] += k;
    ans += dp[u][0];
    printf("%.10lf\n", ans);
  }
  return 0;
}
