#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T sqr(T x) {
  return x * x;
}
const double PI = acos(-1.0);
using namespace std;
struct Node {
  int l, r;
  int mx;
  double p;
  int dep;
  vector<Node *> son;
  vector<double> dp;
  void init(int l, int r, double p) {
    this->l = l;
    this->r = r;
    this->p = p;
    son.clear();
    dp.clear();
  }
  Node() {}
} nd[30005];
int cnt;
Node *newNode(int l, int r, double p) {
  nd[cnt].init(l, r, p);
  return &nd[cnt++];
}
struct Item {
  int l, r;
  double p;
  bool operator<(const Item &it) const {
    if (l == it.l) return r > it.r;
    return l < it.l;
  }
} it[30005];
int n, m;
Node *buildTree(int l, int r, double p, int &i) {
  Node *rt = newNode(l, r, p);
  if (i == m) return rt;
  for (; i < m;) {
    if (l <= it[i].l && it[i].r <= r) {
      i++;
      Node *son = buildTree(it[i - 1].l, it[i - 1].r, it[i - 1].p, i);
      rt->son.push_back(son);
    } else
      break;
  }
  int sz = rt->son.size();
  if (sz) {
    int last = l - 1;
    for (int i = 0; i < sz; i++) {
      Node *ch = rt->son[i];
      if (ch->l > last + 1) {
        Node *son = buildTree(last + 1, ch->l - 1, 0.0, i);
        rt->son.push_back(son);
      }
      last = ch->r;
    }
    if (last != r) {
      Node *son = buildTree(last + 1, r, 0.0, i);
      rt->son.push_back(son);
    }
  }
  return rt;
}
int a[10 * 30005];
double buffer[30005];
void dfs(Node *rt) {
  int sz = rt->son.size();
  rt->dep = 1;
  rt->mx = 0;
  for (int i = 0; i < sz; i++) {
    dfs(rt->son[i]);
    rt->dep = max(rt->dep, rt->son[i]->dep + 1);
    rt->mx = max(rt->mx, rt->son[i]->mx);
  }
  rt->dp.resize(rt->dep + 1);
  fill(rt->dp.begin(), rt->dp.end(), 0);
  if (sz == 0) {
    for (int i = rt->l; i <= rt->r; i++) rt->mx = max(rt->mx, a[i]);
    rt->dp[0] = 1 - rt->p;
    rt->dp[1] = 1;
  } else {
    for (int i = 0; i <= rt->dep; i++) {
      int val = rt->mx + i;
      buffer[i] = 1;
      for (int j = 0; j < sz; j++) {
        Node *ch = rt->son[j];
        int offset = val - ch->mx;
        offset = min(offset, ch->dep);
        buffer[i] *= ch->dp[offset];
      }
    }
    for (int i = 0; i <= rt->dep; i++) {
      if (i + 1 <= rt->dep) rt->dp[i + 1] += buffer[i] * rt->p;
      rt->dp[i] += buffer[i] * (1 - rt->p);
    }
  }
}
int main(void) {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i < m; i++) scanf("%d %d %lf", &it[i].l, &it[i].r, &it[i].p);
  sort(it, it + m);
  int i = 0;
  Node *root = buildTree(1, n, 0.0, i);
  dfs(root);
  double ans = 0;
  int sz = root->dp.size();
  for (int j = sz - 1; j >= 0; j--) {
    if (j) root->dp[j] -= root->dp[j - 1];
    ans += (root->mx + j + 0.0) * root->dp[j];
  }
  printf("%.10lf\n", ans);
  return 0;
}
