#include <bits/stdc++.h>
const int N = 100005;
int n, a[N], p[7], Q, x, y, k, now[N];
double f[N][105], ans = 0;
double C(int x, int y) {
  double ans = 1;
  for (int i = x; i > x - y; i--) ans = ans * i;
  return ans / p[y];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    f[i][a[i]] = 1, now[i] = a[i];
    if (!a[i]) ans += 1;
  }
  p[0] = 1;
  for (int i = 1; i <= 5; i++) p[i] = p[i - 1] * i;
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d%d%d", &x, &y, &k);
    ans -= f[x][0];
    double all = C(now[x], k);
    for (int i = 0; i <= now[x] && i <= a[x]; i++) {
      double ans = 0;
      for (int j = i; j <= i + k && j <= a[x] && j <= now[x]; j++)
        ans += f[x][j] * C(j, j - i) * C(now[x] - j, k - (j - i));
      f[x][i] = ans / all;
    }
    ans += f[x][0];
    now[x] -= k, now[y] += k;
    printf("%.10lf\n", ans);
  }
}
