#include <bits/stdc++.h>
using namespace std;
const int maxn = 5010;
const double eps = 1e-8;
template <typename Tp>
inline int getmin(Tp &x, Tp y) {
  return y < x ? x = y, 1 : 0;
}
template <typename Tp>
inline int getmax(Tp &x, Tp y) {
  return y > x ? x = y, 1 : 0;
}
template <typename Tp>
inline void read(Tp &x) {
  x = 0;
  int f = 0;
  char ch = getchar();
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') f = 1, ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + ch - '0', ch = getchar();
  if (f) x = -x;
}
struct data {
  int v, nxt;
} edge[maxn];
struct query {
  int l, r;
  double p;
  bool operator<(const query &b) const { return l == b.l ? r > b.r : l < b.l; }
} qy[maxn];
int n, q, ep, top, stk[maxn], b[maxn], a[100010], head[maxn], mx[400010];
double ans, f[maxn][maxn];
void insert(int u, int v) {
  edge[++ep] = (data){v, head[u]};
  head[u] = ep;
}
void build(int l, int r, int rt) {
  if (l == r) {
    mx[rt] = a[l];
    return;
  }
  int m = (l + r) >> 1;
  build(l, m, rt << 1);
  build(m + 1, r, rt << 1 | 1);
  mx[rt] = max(mx[rt << 1], mx[rt << 1 | 1]);
}
int qmx(int l, int r, int L, int R, int rt) {
  if (L <= l && r <= R) return mx[rt];
  int m = (l + r) >> 1, res = 0;
  if (L <= m) res = qmx(l, m, L, R, rt << 1);
  if (m < R) getmax(res, qmx(m + 1, r, L, R, rt << 1 | 1));
  return res;
}
void input() {
  read(n);
  read(q);
  for (int i = 1; i <= n; i++) read(a[i]);
  for (int i = 1; i <= q; i++) {
    read(qy[i].l);
    read(qy[i].r);
    scanf("%lf", &qy[i].p);
  }
  build(1, n, 1);
  qy[++q].l = 1;
  qy[q].r = n;
  qy[q].p = 0.0;
  sort(qy + 1, qy + q + 1);
  for (int i = 1; i <= q; i++) {
    while (top && qy[stk[top]].r < qy[i].l) top--;
    insert(stk[top], i);
    stk[++top] = i;
    b[i] = qmx(1, n, qy[i].l, qy[i].r, 1);
  }
}
void dfs(int x) {
  int v;
  double t1, t2 = 1 - qy[x].p;
  for (int i = head[x]; i; i = edge[i].nxt) {
    dfs(edge[i].v);
    t2 *= f[edge[i].v][min(q, b[x] - b[edge[i].v])];
  }
  f[x][0] = t2;
  for (int j = 1; j <= q; j++) {
    t1 = qy[x].p;
    t2 = 1 - qy[x].p;
    for (int i = head[x]; i; i = edge[i].nxt) {
      v = edge[i].v;
      t1 *= f[v][min(q, b[x] - b[v] + j - 1)];
      t2 *= f[v][min(q, b[x] - b[v] + j)];
    }
    f[x][j] = t1 + t2;
  }
}
int main() {
  input();
  dfs(1);
  ans = f[1][0] * mx[1];
  for (int i = 1; i <= q; i++) ans += (f[1][i] - f[1][i - 1]) * (mx[1] + i);
  printf("%.8lf\n", ans);
  return 0;
}
