#include <bits/stdc++.h>
const int MAX_SIZE = 100000;
int cnt[MAX_SIZE + 10], n, m;
long double f[MAX_SIZE + 10][110];
inline void readInt(int& a) {
  a = 0;
  int c;
  do c = getchar();
  while (c < '0' || c > '9');
  do {
    a = a * 10 - '0' + c;
    c = getchar();
  } while (c >= '0' && c <= '9');
};
int main() {
  long double ans = 0.0;
  readInt(n);
  for (int i = 1; i <= n; i++) {
    readInt(cnt[i]);
    f[i][cnt[i]] = 1.0;
    ans += f[i][0];
  }
  readInt(m);
  while (m--) {
    int a, b, d;
    readInt(a);
    readInt(b);
    readInt(d);
    ans -= f[a][0];
    for (int i = 0; i < d; i++) {
      for (int j = 1; j <= 100; j++) {
        f[a][j - 1] += f[a][j] * j / cnt[a];
        f[a][j] *= (long double)(cnt[a] - j) / cnt[a];
      }
      --cnt[a];
    }
    ans += f[a][0];
    cnt[b] += d;
    printf("%.13f\n", (double)ans);
  }
  return 0;
}
