#include <bits/stdc++.h>
using namespace std;
const int M = (int)1e5 + 5;
int n, m;
int a[M], tot[M];
double dp[M][105], p;
int main() {
  scanf("%d", &n);
  double ans = 0;
  for (int i = 1; i <= n; i++)
    scanf("%d", &a[i]), dp[i][a[i]] = 1, tot[i] = a[i], ans += dp[i][0];
  scanf("%d", &m);
  for (int i = 1, x, y, v; i <= m; i++) {
    scanf("%d %d %d", &x, &y, &v);
    ans -= dp[x][0];
    for (int j = 1; j <= v; j++) {
      for (int k = 1; k <= a[x]; k++) {
        p = (double)k / tot[x];
        dp[x][k - 1] += dp[x][k] * p;
        dp[x][k] *= (1 - p);
      }
      tot[x]--;
    }
    tot[y] += v;
    ans += dp[x][0];
    printf("%.12f\n", ans);
  }
  return 0;
}
