#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
const double eps = 1e-12;
int n, m, size[N];
double ans = 0.0, f[N][101], g[101];
double C(int n, int m) {
  if (n < m) return 0.0;
  double ret = 1.0;
  for (int i = (0); i <= (m - 1); i++) ret *= (1.0 * n - i) / (i + 1);
  return ret;
}
double c1[10], c2[10];
void doit(double *f, int T, int k) {
  for (int i = (0); i <= (min(100, T)); i++) g[i] = 0.0;
  double CTK = C(T, k);
  for (int x = (0); x <= (min(100, T)); x++)
    if (f[x] > eps) {
      c1[0] = 1.0;
      for (int y = (1); y <= (min(k, x)); y++)
        c1[y] = c1[y - 1] * (1.0 * x - (y - 1)) / y;
      c2[0] = 1.0;
      for (int y = (1); y <= (min(k, T - x)); y++)
        c2[y] = c2[y - 1] * (1.0 * (T - x) - (y - 1)) / y;
      for (int y = (0); y <= (min(x, k)); y++)
        if (k - y <= T - x) {
          double tmp = c1[y] * c2[k - y];
          g[x - y] += f[x] * tmp / CTK;
        }
    }
  for (int i = (0); i <= (min(100, T)); i++) f[i] = g[i];
}
int main() {
  cin >> n;
  for (int i = (1); i <= (n); i++) {
    scanf("%d", size + i);
    f[i][size[i]] = 1.0;
    ans += f[i][0];
  }
  cin >> m;
  for (int mm = (1); mm <= (m); mm++) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    ans -= f[u][0];
    doit(f[u], size[u], k);
    ans += f[u][0];
    size[v] += k;
    size[u] -= k;
    printf("%.10lf\n", ans);
  }
  return 0;
}
