#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void read(T& x) {
  bool fu = 0;
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  if (c == '-') fu = 1, c = getchar();
  for (x = 0; c > 32; c = getchar()) x = x * 10 + c - '0';
  if (fu) x = -x;
};
template <class T>
inline void read(T& x, T& y) {
  read(x);
  read(y);
}
template <class T>
inline void read(T& x, T& y, T& z) {
  read(x);
  read(y);
  read(z);
}
inline char getc() {
  char c;
  for (c = getchar(); c <= 32; c = getchar())
    ;
  return c;
}
const int N = 100010;
int n, m, i, j, k, l, p;
int a[N], c[N];
long double f[N][111], g[111], ans;
int main() {
  read(n);
  for (i = 1; i <= n; i++) read(a[i]), c[i] = a[i], f[i][a[i]] = 1;
  for (i = 1; i <= n; i++) ans += f[i][0];
  for (read(m); m; m--) {
    int x, y, z, z0;
    read(x, y, z);
    z0 = z;
    ans -= f[x][0];
    for (; z; z--) {
      memcpy(g, f[x], sizeof(f[x]));
      memset(f[x], 0, sizeof(f[x]));
      for (i = 0; i <= min(a[x], c[x]); i++) {
        if (i) f[x][i - 1] += g[i] * i / a[x];
        f[x][i] += g[i] * (1 - 1.0 * i / a[x]);
      }
      a[x]--;
    }
    a[y] += z0;
    ans += f[x][0];
    printf("%.10lf\n", double(ans));
  }
  return 0;
}
