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