#include <bits/stdc++.h>
using namespace std;
int n, a[100005], q, l[5005], r[5005], st[100005][25];
double dp[5005][5005];
struct Q {
  int l, r, Max;
  double p;
} d[5005];
int log(int a) {
  if (a >= (1 << 16)) return log(a >> 16) + 16;
  if (a >= (1 << 8)) return log(a >> 8) + 8;
  if (a >= (1 << 4)) return log(a >> 4) + 4;
  if (a >= (1 << 2)) return log(a >> 2) + 2;
  if (a >= (1 << 1)) return log(a >> 1) + 1;
  return 0;
}
int rmq(int l, int r) {
  return max(st[l][log(r - l + 1)],
             st[r - (1 << log(r - l + 1)) + 1][log(r - l + 1)]);
}
bool cmp(Q a, Q b) {
  if (a.l != b.l) return a.l < b.l;
  return a.r > b.r;
}
int to[10005], nxt[10005], head[5005], cnt;
void add(int a, int b) {
  to[++cnt] = b;
  nxt[cnt] = head[a];
  head[a] = cnt;
}
stack<int> s;
double safedp(int a, int b) {
  if (b > q) return dp[a][q];
  if (b < 0) return 0;
  return dp[a][b];
}
void dfs(int u) {
  for (int i = head[u]; i; i = nxt[i]) dfs(to[i]);
  for (int i = 0; i <= q; i++) {
    double tmp = 1;
    if (i != 0) {
      for (int j = head[u]; j; j = nxt[j])
        tmp *= safedp(to[j], i + d[u].Max - d[to[j]].Max - 1);
      dp[u][i] += d[u].p * tmp;
    }
    tmp = 1;
    for (int j = head[u]; j; j = nxt[j])
      tmp *= safedp(to[j], i + d[u].Max - d[to[j]].Max);
    dp[u][i] += (1 - d[u].p) * tmp;
  }
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) st[i][0] = a[i];
  for (int i = 1; i <= 20; i++)
    for (int j = 1; j <= n - (1 << i) + 1; j++)
      st[j][i] = max(st[j][i - 1], st[j + (1 << (i - 1))][i - 1]);
  for (int i = 1; i <= q; i++)
    scanf("%d%d%lf", &d[i].l, &d[i].r, &d[i].p), d[i].Max = rmq(d[i].l, d[i].r);
  q++;
  d[q].l = 1, d[q].r = n, d[q].p = 0, d[q].Max = rmq(1, n);
  sort(d + 1, d + q + 1, cmp);
  s.push(1);
  for (int i = 2; i <= q; i++) {
    while (!(d[s.top()].l <= d[i].l && d[s.top()].r >= d[i].r)) s.pop();
    add(s.top(), i);
    s.push(i);
  }
  dfs(1);
  double ans = 0;
  for (int i = 0; i <= q; i++) ans += i * (safedp(1, i) - safedp(1, i - 1));
  printf("%.30lf\n", ans + d[1].Max);
  return 0;
}
