#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 50, maxm = 150;
int n, q, x, y, p, a[maxn], d[maxn];
double ans, f[maxn][maxm], c[10 * maxm][10 * maxm];
int read() {
  int x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + (c ^ 48), c = getchar();
  return x;
}
int main() {
  for (int i = 0; i <= 1000; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= i; j++) c[i][j] = c[i - 1][j - 1] + c[i - 1][j];
  }
  n = read();
  for (int i = 1; i <= n; i++)
    a[i] = read(), d[i] = a[i], f[i][a[i]] = 1, ans += f[i][0];
  q = read();
  while (q--) {
    x = read(), y = read(), p = read(), ans -= f[x][0];
    for (int i = 0; i <= a[x]; i++) {
      double s = 0;
      for (int j = 0; j <= min(d[x] - i, p); j++)
        s += f[x][i + j] * c[i + j][j] * c[d[x] - i - j][p - j];
      f[x][i] = s / c[d[x]][p];
    }
    ans += f[x][0], d[x] -= p, d[y] += p;
    printf("%.9lf\n", ans);
  }
  return 0;
}
