#include <bits/stdc++.h>
using namespace std;
int a[100100];
double density[100100][110];
double tmp1[110];
void move(int u, int v) {
  memset(tmp1, 0, sizeof(tmp1));
  for (int i = 0; i <= a[u] && i <= 100; i++) {
    double ratio = (double)i / a[u];
    double cur = density[u][i] * ratio;
    if (i > 0) {
      tmp1[i - 1] += cur;
    }
    tmp1[i] += density[u][i] * (1.0 - ratio);
  }
  memcpy(density[u], tmp1, sizeof(tmp1));
}
void solve() {
  int n;
  cin >> n;
  double ans = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    density[i][a[i]] = 1;
    ans += density[i][0];
  }
  int q;
  cin >> q;
  for (int i = 0; i < q; i++) {
    int u, v, k;
    cin >> u >> v >> k;
    u--;
    v--;
    for (int j = 0; j < k; j++) {
      double ori = density[u][0];
      move(u, v);
      a[u]--;
      double next = density[u][0];
      ans += next - ori;
    }
    a[v] += k;
    cout << ans << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(9);
  long long testn = 1;
  for (long long testi = 1; testi <= testn; testi++) {
    solve();
  }
}
