#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, q, sz[N];
double tmp[105], p[N][105];
double C(int x, int y) {
  double res = 1;
  for (int i = x; i >= x - y + 1; --i) res = res * i;
  for (int i = y; i >= 1; --i) res = res / (double)i;
  return res;
}
double ans = 0;
void change(int l, int r, int x) {
  memset(tmp, 0, sizeof(tmp));
  for (int zero = 0; zero <= x; ++zero)
    for (int choose_pack = 0; choose_pack <= min(sz[l], 100); ++choose_pack)
      if (choose_pack >= zero)
        tmp[choose_pack - zero] += p[l][choose_pack] * C(choose_pack, zero) *
                                   C(sz[l] - choose_pack, x - zero) /
                                   C(sz[l], x);
  ans -= p[l][0];
  for (int zero = 0; zero <= 100; ++zero) p[l][zero] = tmp[zero];
  ans += p[l][0];
  sz[r] += x;
  sz[l] -= x;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &sz[i]);
    p[i][sz[i]] = 1;
    ans += (sz[i] == 0);
  }
  scanf("%d", &q);
  while (q--) {
    int l, r, x;
    scanf("%d%d%d", &l, &r, &x);
    change(l, r, x);
    cout << fixed << setprecision(10) << ans << '\n';
  }
  return 0;
}
