#include <bits/stdc++.h>
using namespace std;
const int maxint = -1u >> 1;
int n, x, y, k, m;
int a[100010], b[100010];
double f[100010][110], ans;
int main() {
  scanf("%d", &n);
  ans = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    f[i][b[i] = a[i]] = 1;
    ans += f[i][0];
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d%d", &x, &y, &k);
    ans -= f[x][0];
    for (int j = 1; j <= k; j++) {
      for (int l = 1; l <= b[x]; l++) {
        f[x][l - 1] += 1.0 * f[x][l] * l / a[x];
        f[x][l] *= 1.0 * (a[x] - l) / a[x];
      }
      a[x]--;
    }
    a[y] += k;
    ans += f[x][0];
    printf("%.10lf\n", ans);
  }
  return 0;
}
