#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
const int N = 101000;
int n, q, u, v, k, a[N], cur[N];
double dp[N][110], ret;
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) {
    scanf("%d", a + i);
    cur[i] = a[i];
    dp[i][cur[i]] = 1;
    ret += (cur[i] == 0);
  }
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    scanf("%d%d%d", &u, &v, &k);
    ret -= dp[u][0];
    for (int j = 0; j < k; j++) {
      for (int s = 0; s < a[u] + 1; s++) {
        if (s > 0) dp[u][s - 1] += dp[u][s] * s / cur[u];
        dp[u][s] = dp[u][s] * (cur[u] - s) / cur[u];
      }
      --cur[u];
    }
    ret += dp[u][0];
    printf("%.10f\n", ret);
    cur[v] += k;
  }
}
