#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
const int M = 105;
long double chance[N][M];
long double jie[M];
bool ever[500105][6];
long double zhv[500105][6];
long double ans = 0.0;
int cc[N];
int data[N];
int n, m;
long double zuhe(int x, int y) {
  if (!ever[x][y]) {
    ever[x][y] = 1;
    if (y == 0)
      zhv[x][y] = 1;
    else if (x == y)
      zhv[x][y] = 1;
    else
      zhv[x][y] = zuhe(x - 1, y) + zuhe(x - 1, y - 1);
  }
  return zhv[x][y];
}
long double calc(int a, int b, int c, int d) {
  long double now = zuhe(b, d);
  now *= zuhe(a - b, c - d);
  now /= zuhe(a, c);
  return now;
}
int main() {
  int i, j;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &data[i]);
    cc[i] = data[i];
    chance[i][data[i]] = 1.0;
    if (!data[i]) ans += 1.0;
  }
  scanf("%d", &m);
  while (m--) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    memset(jie, 0, sizeof jie);
    for (i = min(data[a], cc[a]); i >= 0; i--) {
      int l = max(0, c - cc[a] + i);
      int r = min(c, i);
      for (j = l; j <= r; j++)
        jie[i - j] += chance[a][i] * calc(cc[a], i, c, j);
    }
    ans -= chance[a][0];
    for (i = 0; i <= data[a]; i++) chance[a][i] = jie[i];
    ans += chance[a][0];
    cc[a] -= c;
    cc[b] += c;
    double ansx = ans;
    printf("%.12f\n", ansx);
  }
  return 0;
}
