#include <bits/stdc++.h>
const double eps = 1e-9;
const double pi = acos(-1);
const int oo = 1000000000;
const int mod = 1000000009;
const double E = 2.7182818284590452353602874713527;
using namespace std;
int a[100001], b[100001];
double f[100001][101], C[600001][6];
int main() {
  int n;
  double ans = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    b[i] = a[i];
    f[i][a[i]] = 1;
    ans += f[i][0];
  }
  for (int i = 0; i <= 600000; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= min(i, 5); j++)
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
  }
  int q;
  cin >> q;
  while (q--) {
    int x, y, z;
    scanf("%d%d%d", &x, &y, &z);
    ans -= f[x][0];
    for (int i = 0; i <= min(a[x], b[x]); i++)
      if (f[x][i]) {
        for (int j = 1; j <= min(i, z); j++)
          f[x][i - j] += f[x][i] * C[i][j] * C[a[x] - i][z - j] / C[a[x]][z];
        f[x][i] *= C[i][0] * C[a[x] - i][z - 0] / C[a[x]][z];
      }
    a[x] -= z;
    a[y] += z;
    ans += f[x][0];
    printf("%.12lf\n", ans);
  }
  return 0;
}
