#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5;
const int MAXQ = 5e3;
struct Interval {
  int s, e, maxi;
  double prob;
  Interval(int s, int e, double prob) : s(s), e(e), prob(prob), maxi(0) {}
  bool operator<(const Interval& that) const {
    return make_pair(s, -e) < make_pair(that.s, -that.e);
  }
};
double best[MAXQ + 5][MAXQ + 5];
bool vis[MAXQ + 5][MAXQ + 5];
int parent[MAXQ + 5];
int arr[MAXN + 5];
vector<Interval> intervals;
vector<vector<int> > G;
int n, qs;
double prob(int ind, int atmost) {
  if (atmost > qs) return 1;
  if (atmost < 0) return 0;
  double& ret = best[ind][atmost];
  if (vis[ind][atmost]) return ret;
  vis[ind][atmost] = 1;
  double a = intervals[ind].prob, b = 1 - a;
  if (atmost == 0) a = 0;
  for (int c = 0; c < G[ind].size(); c++) {
    const int diff = intervals[ind].maxi - intervals[G[ind][c]].maxi;
    a *= prob(G[ind][c], atmost - 1 + diff);
    b *= prob(G[ind][c], atmost + diff);
  }
  return ret = a + b;
}
void fillIntervalsInfo() {
  G.clear();
  G.resize(qs);
  memset(parent, 255, sizeof(parent));
  int i = 0;
  stack<int> stk;
  for (int c = 0; c < n; c++) {
    while (i < intervals.size() && intervals[i].s == c) stk.push(i++);
    if (!stk.empty())
      intervals[stk.top()].maxi = max(intervals[stk.top()].maxi, arr[c]);
    while (!stk.empty() && intervals[stk.top()].e == c) {
      int cur = stk.top();
      stk.pop();
      if (!stk.empty()) {
        parent[cur] = stk.top();
        G[stk.top()].push_back(cur);
        intervals[stk.top()].maxi =
            max(intervals[stk.top()].maxi, intervals[cur].maxi);
      }
    }
  }
}
int main() {
  int c, c2;
  scanf("%d%d", &n, &qs);
  int maxi = 0;
  for (c = 0; c < n; c++) {
    scanf("%d", &arr[c]);
    maxi = max(maxi, arr[c]);
  }
  for (c = 0; c < qs; c++) {
    int s, e;
    double prob;
    scanf("%d%d%lf", &s, &e, &prob);
    s--;
    e--;
    intervals.push_back(Interval(s, e, prob));
  }
  sort(intervals.begin(), intervals.end());
  fillIntervalsInfo();
  double ret = 0;
  for (int add = 0; add <= qs; add++) {
    int m = maxi + add;
    double p1 = 1, p2 = !!add;
    for (int q = 0; q < qs; q++)
      if (!~parent[q]) {
        p1 *= prob(q, m - intervals[q].maxi);
        p2 *= prob(q, m - intervals[q].maxi - 1);
      }
    ret += m * (p1 - p2);
  }
  printf("%.12lf\n", ret);
  return 0;
}
