#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e5 + 10, MAXM = (int)1e6 + 10, MAXA = 100 + 10;
long double lfac[MAXM], p[MAXN][MAXA], Tohka;
int n, m, a[MAXN], b[MAXN];
long double C(int n, int k) { return lfac[n] - lfac[k] - lfac[n - k]; }
long double Calc(int n, int k, int a, int b) {
  if (n - a < k - b) return 0;
  return exp(C(a, b) + C(n - a, k - b) - C(n, k));
}
void Work(int first, int k) {
  Tohka -= p[first][0];
  for (int i = 1; i <= b[first]; ++i)
    if (p[first][i]) {
      long double P = p[first][i];
      p[first][i] = 0;
      for (int j = 0; j <= min(i, k); ++j) {
        long double s = P * Calc(a[first], k, i, j);
        p[first][i - j] += s;
      }
    }
  Tohka += p[first][0];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    scanf("%d", &a[i]), p[i][a[i]] = 1, Tohka += p[i][0], b[i] = a[i];
  scanf("%d", &m);
  for (int i = 1; i <= m * 5; ++i) lfac[i] = lfac[i - 1] + log((long double)i);
  cout << setprecision(10);
  for (int i = 1; i <= m; ++i) {
    int first, second, k;
    scanf("%d%d%d", &first, &second, &k);
    Work(first, k);
    a[first] -= k, a[second] += k;
    cout << fixed << Tohka << endl;
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}
