#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, M = 5005;
int n, m;
int a[N], l[M], r[M], mx[M], id[M];
double p[M], f[M][M];
vector<int> G[M];
void dfs(int u) {
  for (int v : G[u]) dfs(v);
  for (int j = 0; j <= m; j++) {
    double s = 1 - p[u];
    for (int v : G[u]) s *= f[v][min(m, j + mx[u] - mx[v])];
    f[u][j] += s;
    if (j) {
      s = p[u];
      for (int v : G[u]) s *= f[v][min(m, j + mx[u] - mx[v] - 1)];
      f[u][j] += s;
    }
  }
}
inline bool cmp(int x, int y) {
  if (l[x] != l[y]) return l[x] < l[y];
  return r[x] > r[y];
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= m; i++) scanf("%d%d%lf", &l[i], &r[i], &p[i]), id[i] = i;
  l[++m] = 1;
  r[m] = n;
  p[m] = 0;
  id[m] = m;
  for (int i = 1; i <= m; i++) {
    for (int j = l[i]; j <= r[i]; j++) mx[i] = max(mx[i], a[j]);
  }
  sort(id + 1, id + m + 1, cmp);
  for (int i = 1; i <= m; i++)
    if (id[i] == m) {
      swap(id[1], id[i]);
      break;
    }
  for (int i = 2; i <= m; i++)
    for (int j = i - 1; j >= 1; j--)
      if (l[id[j]] <= l[id[i]] && r[id[j]] >= r[id[i]]) {
        G[id[j]].push_back(id[i]);
        break;
      }
  dfs(m);
  double ans = 0;
  for (int i = 0; i <= m; i++) {
    ans += (mx[m] + i) * (f[m][i] - (i ? f[m][i - 1] : 0));
  }
  printf("%.8lf", ans);
  return 0;
}
