#include <bits/stdc++.h>
using namespace std;
vector<vector<pair<int, double> > > interval;
vector<vector<double> > dp;
vector<double> proba;
vector<int> A, cnt;
vector<int> stk;
vector<vector<int> > tree;
vector<int> lower;
int n, q;
void DFS(int u) {
  for (int i = 2 * q; i >= lower[u]; i--) {
    dp[u][i] = 1.0;
  }
  for (int i = 0; i < tree[u].size(); i++) {
    int v = tree[u][i];
    DFS(v);
    for (int i = 2 * q; i >= lower[u]; i--) {
      dp[u][i] *= dp[v][i];
    }
  }
  for (int i = 2 * q; i >= lower[u]; i--) {
    dp[u][i] *= 1 - proba[u];
    if (i != 0) {
      dp[u][i] += dp[u][i - 1] * proba[u];
    }
  }
}
int main() {
  cin >> n >> q;
  int tmp;
  int tmp_max = 0;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    A.push_back(tmp);
    tmp_max = max(tmp_max, A[i]);
  }
  if (tmp_max > q) {
    for (int i = 0; i < n; i++) {
      A[i] = max(0, A[i] - tmp_max + q);
    }
  }
  interval.resize(n);
  int l, r;
  double p;
  for (int i = 0; i < q; i++) {
    cin >> l >> r >> p;
    l--, r--;
    interval[l].push_back(make_pair(r, p));
  }
  stk.resize(q + 1);
  tree.resize(q + 1);
  proba.resize(q + 1);
  dp.resize(q + 1);
  lower.resize(q + 1);
  for (int i = 0; i <= q; i++) {
    dp[i].resize(2 * q + 1);
    lower[i] = 0;
  }
  cnt.resize(n);
  for (int i = 0; i < n; i++) {
    cnt[i] = 0;
  }
  int node_id = 0, top = 0;
  stk[top] = node_id;
  for (int i = 0; i < n; i++) {
    sort(interval[i].rbegin(), interval[i].rend());
    for (int j = 0; j < interval[i].size(); j++) {
      cnt[interval[i][j].first]++;
      stk[++top] = ++node_id;
      tree[stk[top - 1]].push_back(node_id);
      proba[node_id] = interval[i][j].second;
    }
    lower[stk[top]] = max(lower[stk[top]], A[i]);
    top -= cnt[i];
  }
  DFS(0);
  double ans = 0;
  for (int i = 1; i <= 2 * q; i++) {
    ans += (dp[0][i] - dp[0][i - 1]) * i;
  }
  if (tmp_max > q) {
    ans += tmp_max - q;
  }
  printf("%.10f\n", ans);
  return 0;
}
