#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
double dp[100007][107];
int n;
int a[100007];
int cur[100007];
double mem[107];
double CC[122][122];
double inv[555];
double C(int n, int m) {
  if (m == 0 || m == n) return 1;
  if (n <= 101) return CC[n][m];
  double ret = 1;
  int j = 1;
  for (int i = n; i >= n - m + 1; --i, ++j) ret = ret * i * inv[j];
  return ret;
}
int main() {
  for (int i = 1; i <= 20; ++i) inv[i] = 1.0 / i;
  for (int i = 0; i < 120; ++i) {
    CC[i][0] = CC[i][i] = 1;
    for (int j = 1; j < i; ++j) CC[i][j] = CC[i - 1][j] + CC[i - 1][j - 1];
  }
  scanf("%d", &n);
  double curr = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    cur[i] = a[i];
    dp[i][a[i]] = 1.0;
    if (!a[i]) ++curr;
  }
  int q, u, v, k;
  scanf("%d", &q);
  while (q--) {
    scanf("%d%d%d", &u, &v, &k);
    --u, --v;
    for (int i = 0; i <= a[u]; ++i) mem[i] = 0;
    curr -= dp[u][0];
    for (int i = 0; i <= a[u] && i <= cur[u]; ++i) {
      double co = 1.0 / C(cur[u], k);
      for (int j = 0; j <= i && j <= k; ++j) {
        double prob = C(i, j) * co * C(cur[u] - i, k - j);
        mem[i - j] += dp[u][i] * prob;
      }
    }
    for (int i = 0; i <= a[u]; ++i) dp[u][i] = mem[i];
    curr += dp[u][0];
    cur[v] += k;
    cur[u] -= k;
    printf("%.10f\n", curr);
  }
  return 0;
}
