#include <bits/stdc++.h>
struct fur {
  int l, r, max;
  double p;
  bool operator<(fur k) const { return l < k.l || l == k.l && r > k.r; }
} a[5055];
int tree[1111111], INI[1111111], q, n, fa[1111111], next[1111111],
    tail[1111111], num[1111111], tot;
double d[5055][5055], ans;
void ini(int now, int l, int r) {
  if (l == r) {
    tree[now] = INI[l];
    return;
  }
  int p = (l + r) / 2;
  ini(now * 2, l, p);
  ini(now * 2 + 1, p + 1, r);
  tree[now] = (((tree[now * 2]) > (tree[now * 2 + 1])) ? (tree[now * 2])
                                                       : (tree[now * 2 + 1]));
}
int find_max(int now, int l, int r, int x, int y) {
  if (l == x && r == y) return tree[now];
  int p = (l + r) / 2;
  if (p >= y)
    return find_max(now * 2, l, p, x, y);
  else if (p < x)
    return find_max(now * 2 + 1, p + 1, r, x, y);
  else {
    int t1 = find_max(now * 2, l, p, x, p),
        t2 = find_max(now * 2 + 1, p + 1, r, p + 1, y);
    return (((t1) > (t2)) ? (t1) : (t2));
  }
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &INI[i]);
  for (int i = 1; i <= q; i++) scanf("%d%d%lf", &a[i].l, &a[i].r, &a[i].p);
  a[++q].l = 1;
  a[q].r = n;
  std::sort(a + 1, a + q + 1);
  for (tot = 1; tot <= q; tot++) tail[tot] = tot;
  for (int i = 2; i <= q; i++)
    for (int j = i - 1;; j = fa[j])
      if (a[j].l <= a[i].l && a[j].r >= a[i].r) {
        fa[i] = j;
        num[tail[j] = next[tail[j]] = ++tot] = i;
        ;
        break;
      }
  ini(1, 1, n);
  for (int i = 1; i <= q; i++) a[i].max = find_max(1, 1, n, a[i].l, a[i].r);
  for (int i = q; i >= 1; i--)
    for (int j = 0; j <= q; j++) {
      double st = 1 - a[i].p;
      for (int k = next[i]; k; k = next[k])
        if (j + a[i].max - a[num[k]].max <= q)
          st *= d[num[k]][j + a[i].max - a[num[k]].max];
      d[i][j] += st;
      st = a[i].p;
      for (int k = next[i]; k; k = next[k])
        if (j + a[i].max - a[num[k]].max <= q)
          st *= d[num[k]][j + a[i].max - a[num[k]].max];
      d[i][j + 1] += st;
    }
  for (int j = 1; j <= q; j++) ans += (d[1][j] - d[1][j - 1]) * (a[1].max + j);
  ans += d[1][0] * a[1].max;
  printf("%.10lf\n", ans);
}
