#include <bits/stdc++.h>
using namespace std;
const double eps(1e-8);
double f[110000][110];
int a[110000];
int num[110000];
int n, m;
int main() {
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    scanf("%d", &a[i]);
    f[i][a[i]] = 1;
    num[i] = a[i];
  }
  scanf("%d", &m);
  double ans = 0;
  for (int i = (1); i <= (n); ++i) ans += f[i][0];
  for (int i = (1); i <= (m); ++i) {
    int x, y, k;
    scanf("%d %d %d", &x, &y, &k);
    ans -= f[x][0];
    for (int d = (1); d <= (k); ++d) {
      double now = 0;
      for (int j = (0); j <= (a[x]); ++j) {
        if (j > num[x]) break;
        f[x][j] =
            f[x][j + 1] * (j + 1) / num[x] + f[x][j] * (num[x] - j) / num[x];
      }
      num[x]--;
    }
    num[y] += k;
    ans += f[x][0];
    printf("%.10lf\n", ans);
  }
}
