#include <bits/stdc++.h>
using namespace std;
int N, cnt[100010], beg_cnt[100010];
double ans = 0, dp[100010][110], buf[110];
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &cnt[i]), dp[i][cnt[i]] = 1;
    beg_cnt[i] = cnt[i];
    if (cnt[i] == 0) ++ans;
  }
  int M;
  scanf("%d", &M);
  for (int i = 0; i < M; ++i) {
    int f, t, how;
    scanf("%d%d%d", &f, &t, &how);
    --f;
    --t;
    for (int S = 0; S < how; ++S) {
      ans -= dp[f][0];
      memset(buf, 0, (beg_cnt[f] + 1) * sizeof(double));
      for (int i = 0; i <= beg_cnt[f]; ++i) {
        buf[i] += dp[f][i] * double(cnt[f] - i) / cnt[f];
        if (i) buf[i - 1] += dp[f][i] * double(i) / cnt[f];
      }
      memcpy(dp[f], buf, (beg_cnt[f] + 1) * sizeof(double));
      --cnt[f];
      ans += dp[f][0];
    }
    cnt[t] += how;
    printf("%.18lf\n", ans);
  }
  return 0;
}
