#include <bits/stdc++.h>
using namespace std;
long long int a[100500];
double tmp[105];
double d[100500][105];
double sum = 0;
double memo[100500 * 6][7];
double C(long long int n, long long int m) {
  if (n < m) return 0.0;
  return memo[n][m];
}
int main() {
  for (long long int i = 0; i < ((long long int)(100500 * 6)); ++i)
    memo[i][0] = 1.0;
  for (long long int i = 0; i < ((long long int)(7)); ++i) memo[i][i] = 1.0;
  for (long long int i = 0; i < ((long long int)(100500 * 6)); ++i)
    for (long long int j = 0; j < ((long long int)(min(7ll, i))); ++j)
      if (j) memo[i][j] = memo[i - 1][j - 1] + memo[i - 1][j];
  long long int n;
  cin >> n;
  for (long long int i = 0; i < ((long long int)(n)); ++i) {
    cin >> a[i];
    d[i][a[i]] = 1.0;
    if (a[i] == 0) sum += 1.0;
  }
  long long int q;
  cin >> q;
  for (long long int i = 0; i < ((long long int)(q)); ++i) {
    long long int u, v, k;
    cin >> u >> v >> k;
    u--;
    v--;
    for (long long int j = 0; j < ((long long int)(105)); ++j) tmp[j] = 0.0;
    for (long long int rem = 0; rem < ((long long int)(105)); ++rem)
      if (d[u][rem] != 0.0)
        for (long long int eat = 0; eat <= min(k, rem); eat++) {
          if (a[u] - rem < 0) continue;
          if (a[u] < k) continue;
          tmp[rem - eat] +=
              d[u][rem] * C(rem, eat) * C(a[u] - rem, k - eat) / C(a[u], k);
        }
    sum -= d[u][0];
    for (long long int j = 0; j < ((long long int)(105)); ++j) d[u][j] = tmp[j];
    sum += d[u][0];
    a[u] -= k;
    a[v] += k;
    printf("%0.20lf\n", sum);
  }
}
