#include <bits/stdc++.h>
using namespace std;
const int N = 100010, M = 105;
int n, m, x, y, z, a[N], In[N];
double res = 0, nCr[M][M], dp[N][M];
double NcR(int n, int r) {
  if (n < r) return 0.0;
  double ret = 1.0;
  for (int i = 0; i < r; i++) ret *= (n - i);
  for (int i = 1; i <= r; i++) ret /= i;
  return (ret);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    In[i] = a[i];
    dp[i][a[i]] = 1.0;
    if (a[i] == 0) res++;
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d %d", &x, &y, &z);
    x--, y--;
    double before = dp[x][0];
    for (int t = 0; t <= a[x]; t++) {
      int nt = In[x] - t;
      for (int take = 1; take <= min(z, t); take++)
        dp[x][t - take] +=
            dp[x][t] * NcR(t, take) * NcR(nt, z - take) / NcR(In[x], z);
      dp[x][t] *= NcR(nt, z) / NcR(In[x], z);
    }
    In[x] -= z, In[y] += z;
    res -= before, res += dp[x][0];
    printf("%.12lf\n", res);
  }
  return 0;
}
