#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][17], 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 < lg[n]; ++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 node {
  int l, r;
  double p;
  inline friend int operator<(const node x, const node y) {
    return x.l ^ y.l ? x.l < y.l : x.r > y.r;
  }
} ln[N];
double f[M][M];
vector<int> e[M];
int high[M], dat[N];
void dfs(int x) {
  high[x] = 1;
  for (auto y : e[x]) dfs(y);
  for (auto y : e[x]) high[x] = max(high[x], high[y] + 1);
  f[x][0] = 1 - ln[x].p;
  for (auto y : e[x]) f[x][0] *= f[y][dat[x] - dat[y]];
  for (int i = 1; i <= m; ++i) {
    double p1 = ln[x].p, p2 = 1 - ln[x].p;
    for (auto y : e[x]) {
      p1 *= f[y][min(m, i + dat[x] - dat[y] - 1)];
      p2 *= f[y][min(m, i + dat[x] - dat[y])];
    }
    f[x][i] = p1 + p2;
  }
}
void build(int &i) {
  int r = ln[i].r, x = i++;
  if (i > m) return;
  while (i <= m && ln[i].l <= r) {
    e[x].push_back(i);
    build(i);
  }
  return;
}
int main() {
  n = read(), m = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  init();
  for (int i = 1; i <= m; ++i)
    ln[i].l = read(), ln[i].r = read(), scanf("%lf", &ln[i].p);
  ln[++m] = (node){1, n, 0};
  sort(ln + 1, ln + m + 1);
  for (int i = 1; i <= m; ++i) dat[i] = query(ln[i].l, ln[i].r);
  int x = 1;
  build(x);
  dfs(1);
  double ans = f[1][0] * dat[1];
  for (int i = 1; i <= high[1]; ++i)
    ans += (f[1][i] - f[1][i - 1]) * (i + dat[1]);
  printf("%.7lf\n", ans);
  return 0;
}
