#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const double eps = 1e-12;
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x > 0 ? 1 : -1;
}
int p[N], a[N];
double C(int x, int y) {
  double res = 1.00;
  for (int i = y; i > y - x; --i) res *= i;
  for (int i = 2; i <= x; ++i) res /= i;
  return res;
}
double calc(int p, int q, int k, int x) {
  return C(x, q) * C(k - x, p - q) / C(k, p);
}
double f[N][110], ans;
int u, v, k, n, m;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", p + i), f[i][p[i]] = 1.00, a[i] = p[i];
    if (a[i] == 0) ans++;
  }
  scanf("%d", &m);
  double tmp, ad;
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d %d", &u, &v, &k);
    for (int o1 = 1; o1 <= a[u]; ++o1)
      if (dcmp(f[u][o1]) != 0) {
        tmp = f[u][o1], f[u][o1] = 0;
        for (int o2 = min(o1, k); o2 >= 0; --o2) {
          ad = tmp * calc(p[u], o1, k, o2);
          f[u][o1 - o2] += ad;
          if (o1 - o2 == 0) ans += ad;
        }
      }
    p[v] += k;
    p[u] -= k;
    printf("%.10lf\n", ans);
  }
  return 0;
}
