#include <bits/stdc++.h>
using namespace std;
double ans, f[100010][110];
int n, m, a[100010], b[100010], aa, bb, cc;
int min(int a, int b) { return a < b ? a : b; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    scanf("%d", &a[i]), f[i][a[i]] = 1, b[i] = a[i], ans += !a[i];
  scanf("%d", &m);
  while (m--) {
    scanf("%d", &aa), scanf("%d", &bb), scanf("%d", &cc);
    for (int i = 1; i <= cc; ++i) {
      ans -= f[aa][0];
      for (int j = 0; j <= min(b[aa], a[aa]); ++j)
        f[aa][j] = (f[aa][j] * (a[aa] - j) + f[aa][j + 1] * (j + 1)) / a[aa];
      --a[aa];
      ans += f[aa][0];
    }
    a[bb] += cc;
    printf("%.10lf\n", ans);
  }
  return 0;
}
