#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double EPS = 1e-6;
const int INF = 0x3fffffff;
const long long LINF = INF * 1ll * INF;
const double PI = acos(-1.0);
using namespace std;
double dp[100005][105];
double tmp[105], a[106], b[106];
int p[100005], mx[100005];
double C(int a, int b) {
  double ans = 1.00000000000;
  for (int i = 1; i <= b; i++) {
    ans *= (a--) / (double)i;
  }
  return ans;
}
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &p[i]);
    mx[i] = p[i];
  }
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i < n; i++) dp[i][p[i]] = 1;
  int m;
  scanf("%d", &m);
  double ans = 0;
  for (int i = 0; i < n; i++) ans += dp[i][0];
  while (m--) {
    int u, v, k;
    scanf("%d %d %d", &u, &v, &k);
    u--, v--;
    ans -= dp[u][0];
    for (int j = 0; j <= mx[u]; j++) a[j] = 0;
    for (int i = 0; i <= k; i++) {
      for (int j = i; k - i <= p[u] - j && j <= mx[u]; j++) {
        double tmp = dp[u][j] * C(j, i) * C(p[u] - j, k - i) / C(p[u], k);
        a[j - i] += tmp;
      }
    }
    for (int j = 0; j <= mx[u]; j++) {
      dp[u][j] = a[j];
    }
    p[u] -= k;
    p[v] += k;
    ans += dp[u][0];
    printf("%.10lf\n", ans);
  }
}
