#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const double eps = 1e-10;
const double PI = acos(-1);
template <class T, class S>
inline void add(T &a, S b) {
  a += b;
  if (a >= mod) a -= mod;
}
template <class T, class S>
inline void sub(T &a, S b) {
  a -= b;
  if (a < 0) a += mod;
}
template <class T, class S>
inline bool chkmax(T &a, S b) {
  return a < b ? a = b, true : false;
}
template <class T, class S>
inline bool chkmin(T &a, S b) {
  return a > b ? a = b, true : false;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, q, a[N], sum[N];
double ans, C[N][107];
double dp[N][107], f[107];
void addPot(int id, int k) { sum[id] += k; }
void subPot(int id, int k) {
  double tmp = dp[id][0];
  memset(f, 0, sizeof(f));
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= k; j++) {
      f[i] += dp[id][i + j] * C[i + j][j] * C[sum[id] - i - j][k - j] /
              C[sum[id]][k];
    }
  }
  for (int i = 0; i <= 100; i++) {
    dp[id][i] = f[i];
  }
  ans += dp[id][0] - tmp;
  sum[id] -= k;
}
int main() {
  for (int i = 0; i < N; i++) {
    for (int j = C[i][0] = 1; j <= min(100, i); j++) {
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
    }
  }
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum[i] = a[i];
    dp[i][a[i]] = 1;
    ans += dp[i][0];
  }
  scanf("%d", &q);
  while (q--) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    subPot(u, k);
    addPot(v, k);
    printf("%.12f\n", ans);
  }
  return 0;
}
