#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
int a[(100000 + 10)], cur[(100000 + 10)];
double dp[(100000 + 10)][110];
int C[110][110];
void init() {
  C[0][0] = 1;
  int n = 110;
  for (int i = 1; i < n; ++i) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; ++j) C[i][j] = C[i - 1][j] + C[i - 1][j - 1];
  }
}
double f(int a, int b) {
  double ret = 1;
  for (int i = 1; i <= b; ++i) ret *= (a - i + 1.0) / i;
  return ret;
}
double cal(int cur, int i, int j, int k) {
  if (cur - i - j < 0 || k - j < 0 || k > cur) return 0;
  if (k - j > cur - i - j) return 0;
  return 1.0 * f(cur - i - j, k - j) * f(i + j, j) / f(cur, k);
}
int read() {
  char c;
  while ((c = getchar()) && !('0' <= c && c <= '9'))
    ;
  int ret = c - '0';
  while ((c = getchar()) && '0' <= c && c <= '9') ret = ret * 10 + c - '0';
  return ret;
}
int main() {
  int n;
  init();
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    cur[i] = a[i];
    dp[i][a[i]] = 1;
  }
  double ans = 0;
  for (int i = 1; i <= n; ++i) ans += dp[i][0];
  int q;
  scanf("%d", &q);
  while (q--) {
    int u, v, k;
    u = read();
    v = read();
    k = read();
    ans -= dp[u][0];
    for (int i = 0; i <= a[u]; ++i) {
      dp[u][i] = dp[u][i] * cal(cur[u], i, 0, k);
      for (int j = 1; i + j <= a[u] && j <= k; ++j) {
        dp[u][i] += dp[u][i + j] * cal(cur[u], i, j, k);
      }
    }
    ans += dp[u][0];
    cur[u] -= k;
    cur[v] += k;
    printf("%.10lf\n", ans);
  }
  return 0;
}
