#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, x, y, z;
int s[100010], now[100010];
double ans, f[100010][110], h[110];
inline double C(int n, int m) {
  double an = 1;
  int i;
  for (i = 0; i <= m - 1; i++) an *= n - i;
  for (i = 2; i <= m; i++) an /= i;
  return an;
}
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++)
    scanf("%d", &s[i]), now[i] = s[i], f[i][s[i]] = 1, ans += f[i][0];
  scanf("%d", &m);
  for (i = 1; i <= m; i++) {
    scanf("%d%d%d", &x, &y, &z);
    double sum = C(now[x], z), an = 0;
    for (j = 0; j <= s[x]; j++) h[j] = 0;
    for (j = 0; j <= s[x]; j++)
      if (f[x][j]) {
        for (k = 0; k <= min(j, z); k++) {
          if (now[x] - j < z - k) continue;
          h[j - k] += C(j, k) * C(now[x] - j, z - k) / sum * f[x][j];
        }
      }
    ans = ans - f[x][0] + h[0];
    for (j = 0; j <= s[x]; j++) f[x][j] = h[j];
    now[x] -= z;
    now[y] += z;
    printf("%.12lf\n", ans);
  }
  return 0;
}
