#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ '0'), c = getchar();
  return x * f;
}
const int N = 1e5 + 5, M = 5e3 + 5;
int n, m, a[N], mx[N][21], lg[N];
inline void init() {
  for (int i = 1; i <= n; i++) lg[i] = lg[i - 1] + ((1 << lg[i - 1]) == i);
  for (int i = 1; i <= n; i++) mx[i][0] = a[i];
  for (int k = 1; k <= 20; k++)
    for (int i = 1; i <= n - (1 << k) + 1; i++)
      mx[i][k] = max(mx[i][k - 1], mx[i + (1 << (k - 1))][k - 1]);
}
inline int query(int l, int r) {
  int k = lg[r - l + 1] - 1;
  return max(mx[l][k], mx[r - (1 << k) + 1][k]);
}
struct line {
  int l, r;
  double p;
  int mx;
} ln[N];
inline int cmp(line x, line y) { return x.l ^ y.l ? x.l < y.l : x.r > y.r; }
double f[M][M];
vector<int> e[M];
void dfs(int x) {
  for (auto y : e[x]) dfs(y);
  f[x][0] = 1 - ln[x].p;
  for (auto y : e[x]) f[x][0] *= f[y][ln[x].mx - ln[y].mx];
  for (int i = 1; i <= m; i++) {
    double p1 = 1, p2 = 1;
    for (auto y : e[x]) {
      p1 *= f[y][min(m, i + ln[x].mx - ln[y].mx - 1)];
      p2 *= f[y][min(m, i + ln[x].mx - ln[y].mx)];
    }
    f[x][i] = ln[x].p * p1 + (1 - ln[x].p) * p2;
  }
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  init();
  for (int i = 1; i <= m; i++) {
    int l = read(), r = read(), mx;
    double p;
    scanf("%lf", &p);
    mx = query(l, r);
    ln[i] = (line){l, r, p, mx};
  }
  ln[++m] = (line){1, n, 0, query(1, n)};
  sort(ln + 1, ln + m + 1, cmp);
  for (int i = 2; i <= m; i++)
    for (int j = i - 1; j >= 1; j--)
      if (ln[i].l >= ln[j].l && ln[i].r <= ln[j].r) {
        e[j].push_back(i);
        break;
      }
  dfs(1);
  double ans = 0;
  for (int i = 0; i <= m; i++)
    ans += (f[1][i] - (!i ? 0 : f[1][i - 1])) * (i + ln[1].mx);
  printf("%.7lf\n", ans);
  return 0;
}
