#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
double dp[maxn][105];
int a[maxn], b[maxn];
int main() {
  int n, i, j, q, u, v, k;
  double now = 0.0;
  cin >> n;
  for (i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i];
    dp[i][0] = 0;
    dp[i][a[i]] = 1.0;
    now += dp[i][0];
  }
  cin >> q;
  while (q--) {
    scanf("%d%d%d", &u, &v, &k);
    now -= dp[u][0];
    for (i = 1; i <= k; i++) {
      for (j = 0; j <= b[u]; j++)
        dp[u][j] = dp[u][j] * (a[u] - j) / a[u] + dp[u][j + 1] * (j + 1) / a[u];
      a[u]--;
    }
    now += dp[u][0];
    a[v] += k;
    printf("%.12lf\n", now);
  }
}
