#include <bits/stdc++.h>
using namespace std;
const int N = 3003;
double dp[100005][112];
int n, a[100005], now[100005 * 2], q;
double C(int n, int m) {
  double ans = 1.0;
  for (int i = 1; i <= m; ++i) ans *= (n - i + 1) * 1.0 / i;
  return ans;
}
int main() {
  double ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i)
    scanf("%d", &a[i]), now[i] = a[i], dp[i][a[i]] = 1, ans += dp[i][0];
  scanf("%d", &q);
  while (q--) {
    int u, v, k;
    scanf("%d %d %d", &u, &v, &k);
    ans -= dp[u][0];
    for (int i = 0; i <= a[u]; ++i) {
      double tmp = 0, zo = C(now[u], k);
      for (int j = 0; j <= k; ++j)
        tmp += dp[u][i + j] * C(i + j, j) * C(now[u] - i - j, k - j) / zo;
      dp[u][i] = tmp;
    }
    now[u] -= k;
    now[v] += k;
    ans += dp[u][0];
    printf("%.10f\n", ans);
  }
  return 0;
}
