#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 5;
const int MAXM = 5005;
int n, m, np;
int ST[17][MAXN], lg[MAXN];
int h[MAXM], dep[MAXM];
double f[MAXM][MAXM], ans;
struct vl {
  int l, r;
  double p;
  int mx;
} v[MAXM];
struct rpg {
  int li, nx;
} a[MAXM];
void add(int ls, int nx) {
  a[++np] = (rpg){h[ls], nx};
  h[ls] = np;
}
int read() {
  int x = 0;
  char ch = getchar();
  while (ch < '0' || '9' < ch) ch = getchar();
  while ('0' <= ch && ch <= '9')
    x = (x << 3) + (x << 1) + (ch ^ 48), ch = getchar();
  return x;
}
bool cmp(vl a, vl b) { return a.l == b.l ? a.r > b.r : a.l < b.l; }
int Getmx(int l, int r) {
  int tmp = lg[r - l + 1];
  return max(ST[tmp][r], ST[tmp][l + (1 << tmp) - 1]);
}
void dfs(int x) {
  dep[x] = 1;
  v[x].mx = Getmx(v[x].l, v[x].r);
  for (int i = h[x]; i; i = a[i].li)
    dfs(a[i].nx), dep[x] = max(dep[x], dep[a[i].nx] + 1);
  for (int j = 0; j <= dep[x]; ++j) {
    double p1 = j ? v[x].p : 0, p2 = 1 - v[x].p;
    for (int i = h[x]; i; i = a[i].li) {
      if (j + v[x].mx - v[a[i].nx].mx - 1 >= 0)
        p1 *= f[a[i].nx][min(m + 1, j + v[x].mx - v[a[i].nx].mx - 1)];
      p2 *= f[a[i].nx][min(m + 1, j + v[x].mx - v[a[i].nx].mx)];
    }
    f[x][j] = p1 + p2;
  }
  for (int i = dep[x] + 1; i <= m + 1; ++i) f[x][i] = 1;
  return;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i)
    ST[0][i] = read(), lg[i] = i >> lg[i - 1] + 1 ? lg[i - 1] + 1 : lg[i - 1];
  for (int i = 1; i <= lg[n]; ++i) {
    int tmp = 1 << i - 1;
    for (int j = tmp << 1; j <= n; ++j) {
      ST[i][j] = max(ST[i - 1][j], ST[i - 1][j - tmp]);
    }
  }
  for (int i = 1; i <= m; ++i)
    v[i].l = read(), v[i].r = read(), scanf("%lf", &v[i].p);
  v[++m] = (vl){1, n, 0.0};
  sort(v + 1, v + m + 1, cmp);
  for (int i = 2; i <= m; ++i) {
    for (int j = i - 1; j; --j) {
      if (v[j].r >= v[i].r) {
        add(j, i);
        break;
      }
    }
  }
  dfs(1);
  ans = f[1][0] * v[1].mx;
  for (int i = 1; i <= dep[1]; ++i)
    ans += (f[1][i] - f[1][i - 1]) * (v[1].mx + i);
  printf("%.7lf\n", ans);
  return 0;
}
