#include <bits/stdc++.h>
using namespace std;
const int mm = 100010;
double f[mm][110], ans;
int a[mm], b[mm], x, y, k, i, j, l, n, m;
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; ++i)
    scanf("%d", &a[i]), f[i][b[i] = a[i]] = 1, ans += f[i][0];
  scanf("%d", &m);
  for (i = 1; i <= m; ++i) {
    scanf("%d%d%d", &x, &y, &k);
    ans -= f[x][0];
    for (j = 1; j <= k; ++j) {
      for (l = 1; l <= b[x]; ++l) {
        f[x][l - 1] += f[x][l] * l / a[x];
        f[x][l] *= 1.0 * (a[x] - l) / a[x];
      }
      a[x]--;
    }
    a[y] += k;
    ans += f[x][0];
    printf("%.10lf\n", ans);
  }
}
