#include <bits/stdc++.h>
using namespace std;
double P[100009][101], tmp[109];
int n, a[100009], Q, u, v, num[100009], k;
double C(int n, int k) {
  if (n < k) return 0;
  double ans = 1;
  for (int i = 0; i < k; i++) {
    ans = ans * (n - i) / (i + 1);
  }
  return ans;
}
int main() {
  double ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    P[i][a[i]] = 1;
    ans += P[i][0];
    num[i] = a[i];
  }
  scanf("%d", &Q);
  while (Q--) {
    scanf("%d%d%d", &u, &v, &k);
    for (int i = 0; i <= a[u]; i++) tmp[i] = 0;
    for (int i = 0; i <= a[u] && i <= num[u]; i++) {
      for (int j = 0; j <= i && j <= k; j++) {
        tmp[i - j] += P[u][i] * C(i, j) * C(num[u] - i, k - j) / C(num[u], k);
      }
    }
    num[u] -= k;
    num[v] += k;
    ans -= P[u][0];
    for (int i = 0; i <= a[u]; i++) P[u][i] = tmp[i];
    ans += P[u][0];
    printf("%.15f\n", ans);
  }
  return 0;
}
