#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16777216")
const int inf = 0x3f3f3f3f;
const long double pi = acos(-1.0);
const string debug_line = "yolo";
const double PI = 4 * atan(1);
double nCr[500100][6];
double dp[100010][105];
int a[100010];
int count1[100010];
double dp1[105];
int main() {
  int n;
  scanf("%d", &n);
  for (int(i) = (1); (i) < (n + 1); ++(i)) {
    int temp;
    scanf("%d", &temp);
    a[i] = temp;
    count1[i] = temp;
    dp[i][a[i]] = 1.0;
  }
  nCr[0][0] = 1.0;
  for (int(i) = (1); (i) < (500100); ++(i)) {
    nCr[i][0] = 1.0;
    for (int(j) = (1); (j) < (6); ++(j)) {
      nCr[i][j] = (nCr[i - 1][j - 1] + nCr[i - 1][j]);
    }
  }
  int m;
  scanf("%d", &m);
  double answer1 = 0;
  for (int(i) = (1); (i) < (n + 1); ++(i)) {
    answer1 = answer1 + dp[i][0];
  }
  while (m--) {
    int a1, b1, c1;
    scanf("%d%d%d", &a1, &b1, &c1);
    answer1 = answer1 - dp[a1][0];
    for (int(j) = (0); (j) < (105); ++(j)) {
      dp1[j] = dp[a1][j];
      dp[a1][j] = 0;
    }
    for (int(i) = (0); (i) < (c1 + 1); ++(i)) {
      for (int j = 0; j + i <= count1[a1] && j + i <= a[a1]; j++) {
        double temp1 = nCr[i + j][i] * nCr[count1[a1] - (i + j)][c1 - i] /
                       nCr[count1[a1]][c1] * dp1[i + j];
        dp[a1][j] += temp1;
      }
    }
    answer1 = answer1 + dp[a1][0];
    count1[a1] -= c1;
    count1[b1] += c1;
    printf("%.12lf\n", answer1);
  }
  return 0;
}
