#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, q;
int a[N], b[N];
double f[N][110], ans;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d", &a[i]), b[i] = a[i], f[i][b[i]] = 1, ans += f[i][0];
  for (scanf("%d", &q); q--;) {
    int u, v, k;
    scanf("%d%d%d", &u, &v, &k);
    ans -= f[u][0];
    for (int i = 1; i <= k; i++, a[u]--)
      for (int j = 0; j <= b[u]; j++)
        if (j <= a[u])
          f[u][j] = f[u][j + 1] * (j + 1) / a[u] + f[u][j] * (a[u] - j) / a[u];
        else
          f[u][j] = 0;
    ans += f[u][0];
    a[v] += k;
    printf("%.12lf\n", ans);
  }
  return 0;
}
