#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
const int Q = 5000 + 100;
struct Node {
  int l, r, mx, ce;
  double p;
  bool operator<(const Node& th) const {
    if (l != th.l) return l < th.l;
    return r > th.r;
  }
} node[Q];
struct Edge {
  int v, next;
} e[Q];
int head[Q], total;
void adde(int u, int v) {
  e[total].v = v;
  e[total].next = head[u];
  head[u] = total++;
}
void init() {
  memset(head, -1, sizeof(head));
  total = 0;
}
void Insert(int u, int f) {
  for (int i = head[f]; i != -1; i = e[i].next) {
    int v = e[i].v;
    if (node[v].l <= node[u].l && node[v].r >= node[u].r) {
      Insert(u, v);
      return;
    }
  }
  adde(f, u);
}
int Log[N];
int Dp[N][30];
double dp[Q][Q];
int aa[N];
int n, q;
void RMQ() {
  for (int i = 1; i <= n; i++) Dp[i][0] = aa[i];
  for (int i = 1; i <= Log[n]; i++) {
    int k = 1 << i;
    for (int j = 1; j <= n - k + 1; j++) {
      Dp[j][i] = max(Dp[j][i - 1], Dp[j + k / 2][i - 1]);
    }
  }
}
int query(int l, int r) {
  int k = Log[r - l + 1];
  int tmp = 1 << k;
  return max(Dp[l][k], Dp[r - tmp + 1][k]);
}
void dfs(int u) {
  int tmp = 0;
  for (int i = head[u]; i != -1; i = e[i].next) {
    int v = e[i].v;
    dfs(v);
    tmp = max(tmp, node[v].ce);
  }
  node[u].ce = tmp + 1;
  for (int i = 0; i <= node[u].ce; i++) {
    double tmp1 = 1 - node[u].p;
    double tmp2 = node[u].p;
    if (i == 0) tmp2 = 0;
    for (int j = head[u]; j != -1; j = e[j].next) {
      int v = e[j].v;
      if (node[u].mx + i - node[v].mx <= node[v].ce) {
        tmp1 *= dp[v][node[u].mx + i - node[v].mx];
      }
      if (node[u].mx + i - 1 - node[v].mx <= node[v].ce) {
        if (node[u].mx + i - 1 - node[v].mx >= 0)
          tmp2 *= dp[v][node[u].mx + i - 1 - node[v].mx];
        else
          tmp2 = 0;
      }
    }
    dp[u][i] = tmp1 + tmp2;
  }
}
int main() {
  Log[1] = 0;
  int tmp = 2;
  for (int i = 2; i <= 100000; i++) {
    if (i == tmp) {
      Log[i] = Log[i - 1] + 1;
      tmp *= 2;
    } else {
      Log[i] = Log[i - 1];
    }
  }
  while (scanf("%d%d", &n, &q) != EOF) {
    for (int i = 1; i <= n; i++) {
      scanf("%d", &aa[i]);
    }
    RMQ();
    for (int i = 0; i < q; i++) {
      scanf("%d%d%lf", &node[i].l, &node[i].r, &node[i].p);
    }
    node[q].l = 1, node[q].r = n, node[q].p = 0;
    q++;
    sort(node, node + q);
    for (int i = 0; i < q; i++) {
      node[i].mx = query(node[i].l, node[i].r);
    }
    init();
    for (int i = 1; i < q; i++) {
      Insert(i, 0);
    }
    dfs(0);
    double ans = dp[0][0] * node[0].mx;
    for (int i = 1; i <= node[0].ce; i++) {
      ans += (dp[0][i] - dp[0][i - 1]) * (node[0].mx + i);
    }
    printf("%.12lf\n", ans);
  }
  return 0;
}
