#include <bits/stdc++.h>
using namespace std;
struct node {
  int l, r;
  double p;
} a[5005];
int f[100005][18], mx[100005], used[100005], n, m;
double ans[5005][5005], tmp[5005];
inline int ask(int x, int y) {
  int len = (int)log2(y - x + 1);
  return max(f[x][len], f[y - (1 << len) + 1][len]);
}
int cmp(const node &a, const node &b) { return a.r - a.l < b.r - b.l; }
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &f[i][0]);
  for (int j = 1; j <= 17; j++)
    for (int i = 1; i <= n; i++) {
      int T = i + (1 << (j - 1));
      f[i][j] = max(f[i][j - 1], (T <= n) ? f[T][j - 1] : 0);
    }
  for (int i = 1; i <= m; i++) scanf("%d%d%lf", &a[i].l, &a[i].r, &a[i].p);
  a[++m] = (node){1, n, 0};
  sort(a + 1, a + m + 1, cmp);
  for (int i = 1; i <= m; i++) {
    mx[i] = ask(a[i].l, a[i].r);
    for (int k = 0; k <= m; k++) tmp[k] = 1.0;
    for (int j = 1; j < i; j++)
      if (a[j].l >= a[i].l && a[j].r <= a[i].r && !used[j]) {
        used[j] = 1;
        for (int k = 0; k <= m; k++)
          if (mx[i] + k - mx[j] <= m) tmp[k] *= ans[j][mx[i] + k - mx[j]];
      }
    for (int k = m; k; k--) tmp[k] -= tmp[k - 1];
    ans[i][0] = (1 - a[i].p) * tmp[0];
    for (int k = 1; k <= m; k++)
      ans[i][k] = ans[i][k - 1] + tmp[k - 1] * a[i].p + tmp[k] * (1 - a[i].p);
  }
  double ANS = ans[m][0] * mx[m];
  for (int i = 1; i <= m; i++) ANS += (ans[m][i] - ans[m][i - 1]) * (mx[m] + i);
  printf("%.10f\n", ANS);
  return 0;
}
