#include <bits/stdc++.h>
using namespace std;
long double F(int A, int B) {
  long double S = 1;
  for (int i = 0; i < B; i++) S = S * (A - i) / (i + 1);
  return S;
}
int main() {
  int N;
  scanf("%d", &N);
  static int C[100000], Max[100000];
  static long double P[100000][101];
  memset(P, 0, sizeof(P));
  for (int i = 0; i < N; i++) {
    scanf("%d", &C[i]);
    Max[i] = C[i];
    P[i][C[i]] = 1;
  }
  int Query;
  scanf("%d", &Query);
  long double Ans = 0;
  for (int i = 0; i < N; i++)
    if (!C[i]) Ans++;
  while (Query--) {
    int a, b, K;
    scanf("%d%d%d", &a, &b, &K);
    a--;
    b--;
    static long double DP[101];
    memset(DP, 0, sizeof(DP));
    long double All = F(C[a], K);
    for (int i = 0; i <= C[a] && i <= Max[a]; i++)
      for (int j = max(0, K - C[a] + i); j <= K && j <= i; j++)
        DP[i - j] += P[a][i] * F(i, j) * F(C[a] - i, K - j) / All;
    Ans += DP[0] - P[a][0];
    for (int i = 0; i <= Max[a]; i++) P[a][i] = DP[i];
    C[a] -= K;
    C[b] += K;
    printf("%0.10lf\n", (double)Ans);
  }
  return 0;
}
