#include <bits/stdc++.h>
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e5 + 5;
const double eps = 1e-9;
using namespace std;
double dp[MAXN][105];
int a[MAXN], b[MAXN];
int main() {
  int n;
  double cnt = 0;
  scanf("%d", &(n));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &(a[i]));
    b[i] = a[i];
    dp[i][a[i]] = 1;
    cnt += dp[i][0];
  }
  int q;
  scanf("%d", &(q));
  while (q--) {
    int u, v, k;
    scanf("%d", &(u)), scanf("%d", &(v)), scanf("%d", &(k));
    cnt -= dp[u][0];
    for (int i = 1, tmp = a[u]; i <= k; i++, tmp--)
      for (int j = 0; j <= b[u]; j++)
        dp[u][j] = dp[u][j] * (tmp - j) / tmp + dp[u][j + 1] * (j + 1) / tmp;
    cnt += dp[u][0];
    a[u] -= k;
    a[v] += k;
    printf("%.20f\n", cnt);
  }
  return 0;
}
