#include <bits/stdc++.h>
using std::max;
using std::min;
const int N = 1e5 + 5, M = 5e3 + 5;
int n, q, val[N << 2];
void build(int l, int r, int u) {
  if (l == r)
    scanf("%d", &val[u]);
  else {
    int mid = (l + r) >> 1;
    build(l, mid, u << 1);
    build(mid + 1, r, u << 1 | 1);
    val[u] = std::max(val[u << 1], val[u << 1 | 1]);
  }
}
int query(int ql, int qr, int l, int r, int u) {
  if (ql <= l && r <= qr)
    return val[u];
  else {
    int mid = (l + r) >> 1;
    int res = 0;
    if (ql <= mid) res = max(res, query(ql, qr, l, mid, u << 1));
    if (qr > mid) res = max(res, query(ql, qr, mid + 1, r, u << 1 | 1));
    return res;
  }
}
struct Section {
  int l, r, mx;
  double p;
  inline bool operator<(const Section& t) const {
    return l == t.l ? r > t.r : l < t.l;
  }
} s[M];
std::vector<int> g[M];
int lim[M];
double f[M][M];
void dfs(int u) {
  lim[u] = 1;
  for (auto v : g[u]) dfs(v), lim[u] = max(lim[u], lim[v] + 1);
  for (int j = 0; j <= lim[u]; ++j) {
    double p1 = (j ? s[u].p : 0.0), p2 = 1.0 - s[u].p;
    for (auto v : g[u]) {
      if (j + s[u].mx - s[v].mx - 1 >= 0) {
        p1 *= f[v][min(q + 1, j + s[u].mx - s[v].mx - 1)];
      }
      p2 *= f[v][min(q + 1, j + s[u].mx - s[v].mx)];
    }
    f[u][j] = p1 + p2;
  }
  for (int j = lim[u] + 1; j <= q + 1; ++j) f[u][j] = 1.0;
}
int main() {
  scanf("%d%d", &n, &q);
  build(1, n, 1);
  for (int i = 1; i <= q; ++i) {
    scanf("%d%d%lf", &s[i].l, &s[i].r, &s[i].p);
    s[i].mx = query(s[i].l, s[i].r, 1, n, 1);
  }
  s[++q] = (Section){1, n, val[1], 0};
  std::sort(s + 1, s + 1 + q);
  for (int i = 1; i <= q; ++i)
    for (int j = i - 1; j >= 1; --j) {
      if (s[j].l <= s[i].l && s[i].r <= s[j].r) {
        g[j].push_back(i);
        break;
      }
    }
  dfs(1);
  double mx = val[1], ans = f[1][0] * mx;
  for (int i = 1; i <= lim[1]; ++i) ans += (f[1][i] - f[1][i - 1]) * (mx + i);
  return printf("%.6lf\n", ans), 0;
}
