#include <bits/stdc++.h>
using namespace std;
double f[100010][155], ans, g[155], c[100010][6];
int n, a[100010], u, v, k, m;
void Read(int &x) {
  static char c;
  for (c = getchar(); c < '0' || c > '9'; c = getchar())
    ;
  for (x = 0; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
}
double C(int n, int m) {
  double tmp = 1;
  for (int i = n; i > n - m; i--) tmp *= i;
  for (int i = m; i; i--) tmp /= i;
  return tmp;
}
int main() {
  Read(n);
  for (int i = 1; i <= n; i++) {
    Read(a[i]);
    f[i][a[i]] = 1;
    if (a[i] == 0) ans += 1.0;
  }
  Read(m);
  for (int i = 0; i <= 100000; i++)
    for (int j = 0; j <= min(i, 5); j++) c[i][j] = C(i, j);
  for (int i = 0; i < m; i++) {
    Read(u);
    Read(v);
    Read(k);
    ans -= f[u][0];
    memset(g, 0, sizeof(g));
    for (int j = 0; j <= min(a[u], 100); j++)
      for (int l = 0; l <= k; l++)
        if (j >= l && a[u] - j >= k - l)
          g[j - l] += f[u][j] * c[j][l] / c[a[u]][k] * c[a[u] - j][k - l];
    memcpy(f[u], g, sizeof(g));
    a[u] -= k;
    a[v] += k;
    ans += f[u][0];
    printf("%.10f\n", ans);
  }
  return 0;
}
