#include <bits/stdc++.h>
using namespace std;
bool debug = false;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
double p[100005][105];
int a[100005], b[100005];
double ans;
void cal(int i) {
  double pre = p[i][0];
  for (int j = 0; j <= a[i]; j++) {
    p[i][j] = p[i][j] * (b[i] - j) / b[i] + p[i][j + 1] * (j + 1) / b[i];
  }
  ans += p[i][0] - pre;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    b[i] = a[i];
    p[i][a[i]] = 1;
    if (a[i] == 0) ans += 1;
  }
  scanf("%d", &m);
  int u, v;
  for (int(i) = 0; (i) < (int)(m); (i)++) {
    scanf("%d%d%d", &u, &v, &k);
    for (int(j) = 0; (j) < (int)(k); (j)++) {
      cal(u);
      b[u]--;
    }
    b[v] += k;
    printf("%.12lf\n", ans);
  }
  return 0;
}
