#include <bits/stdc++.h>
using namespace std;
const int nn = 110000;
pair<int, int> w[nn], q[nn];
int d[nn][21], m[nn], da[nn], pi[nn];
vector<int> E[nn];
double Q[nn];
double a[5100][5100], g[nn];
int N, qq;
bool cmp(int x, int y) {
  return q[x].first < q[y].first ||
         q[x].first == q[y].first && q[x].second > q[y].second;
}
struct point {
  int l, r, id;
  point() {}
  point(int a, int b, int c) : l(a), r(b), id(c) {}
};
bool operator<(const point &x, const point &y) {
  return x.r < y.r || x.r == y.r && x.l > y.l ||
         (x.r == y.r && x.l == y.l && x.id > y.id);
}
multiset<point> A;
int RMQ(int l, int r) {
  int t = int(log2(r - l + 1));
  return max(d[l][t], d[r - (1 << t) + 1][t]);
}
void dfs(int x) {
  m[x] = RMQ(w[x].first, w[x].second);
  for (int i = 0; i < E[x].size(); ++i) {
    int j = E[x][i];
    dfs(j);
  }
  if (!((int)E[x].size())) {
    a[x][1] = 1;
    a[x][0] = 1 - Q[x];
    for (int i = 2; i <= 5000; ++i) a[x][i] = a[x][i - 1];
    return;
  }
  for (int i = 0; i <= 5000; ++i) {
    double t1 = Q[x], t2 = 1. - t1;
    for (int j = 0; j < E[x].size(); ++j) {
      int k = E[x][j];
      if (m[x] + i - m[k] - 1 >= 0)
        t1 *= a[k][min(5000, m[x] + i - m[k] - 1)];
      else
        t1 *= 0;
      if (m[x] + i - m[k] >= 0)
        t2 *= a[k][min(5000, m[x] + i - m[k])];
      else
        t2 *= 0;
    }
    if (i == 0) t1 = 0;
    a[x][i] = t1 + t2;
  }
}
int main() {
  scanf("%d%d", &N, &qq);
  for (int i = 1; i <= N; ++i) scanf("%d", &da[i]), d[i][0] = da[i];
  for (int j = 1; j <= 20; ++j)
    for (int i = 1; i <= N; ++i) {
      if (i + (1 << j) - 1 > N) break;
      d[i][j] = max(d[i][j - 1], d[i + (1 << (j - 1))][j - 1]);
    }
  for (int i = 1; i <= qq; ++i)
    scanf("%d%d%lf", &q[i].first, &q[i].second, &g[i]), pi[i] = i;
  sort(pi + 1, pi + 1 + qq, cmp);
  A.insert(point(1, N, 1));
  w[1] = make_pair(1, N);
  int M = 1;
  Q[M] = 0;
  for (int _ = 1; _ <= qq; ++_) {
    int i = pi[_];
    point t = *A.lower_bound(point(q[i].first, q[i].second, 10000));
    M++;
    w[M] = q[i];
    Q[M] = g[i];
    A.insert(point(q[i].first, q[i].second, M));
    E[t.id].push_back(M);
  }
  dfs(1);
  double ans = a[1][0] * m[1];
  for (int i = 1; i <= 5000; ++i) ans += (a[1][i] - a[1][i - 1]) * (m[1] + i);
  printf("%.10f\n", ans);
  return 0;
}
