#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int M = 110;
const int maxn = 1e7 + 10;
int gi() {
  int x = 0, o = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') o = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  return x * o;
}
int n, q, a[N];
double f[N][M], ans = 0;
double C(int n, int m) {
  if (n < 0 || m < 0 || n < m) return 0;
  double ret = 1;
  for (int i = 1; i <= m; i++) ret = ret / i * (n - i + 1);
  return ret;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) a[i] = gi(), f[i][a[i]] = 1, ans += f[i][0];
  cin >> q;
  while (q--) {
    int u = gi(), v = gi(), k = gi();
    ans -= f[u][0];
    for (int j = 0; j <= 100; j++) {
      double tmp = 0;
      for (int l = 0; l <= k; l++)
        tmp = (tmp + f[u][j + l] * C(j + l, l) * C(a[u] - j - l, k - l));
      tmp /= C(a[u], k);
      f[u][j] = tmp;
    }
    a[u] -= k;
    a[v] += k;
    ans += f[u][0];
    printf("%.10lf\n", ans);
  }
  return 0;
}
