#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void amin(T &x, U y) {
  if (y < x) x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y) {
  if (x < y) x = y;
}
int main() {
  int n, q;
  scanf("%d%d", &n, &q);
  vector<int> a(n);
  for (int(i) = 0; (i) < (int)(n); ++(i)) scanf("%d", &a[i]);
  int ma = *max_element((a).begin(), (a).end());
  int V = q + 1;
  vector<int> l(V), r(V);
  vector<double> p(V);
  for (int(i) = 0; (i) < (int)(q); ++(i))
    scanf("%d%d%lf", &l[i], &r[i], &p[i]), --l[i], --r[i];
  l[q] = 0, r[q] = n - 1, p[q] = 0;
  vector<pair<int, int> > sorted;
  for (int(i) = 0; (i) < (int)(V); ++(i))
    sorted.push_back(make_pair((r[i] - l[i]), (i)));
  sort((sorted).begin(), (sorted).end());
  vector<vector<int> > g(V);
  vector<int> leafmax(V);
  {
    map<int, int> t;
    for (int(i) = 0; (i) < (int)(n); ++(i)) t[i] = -1;
    for (int(ix) = 0; (ix) < (int)(sorted.size()); ++(ix)) {
      int i = sorted[ix].second;
      auto left = t.lower_bound(l[i]);
      auto right = t.upper_bound(r[i]);
      int mx = -0x3f3f3f3f;
      for (auto it = left; it != right; ++it) {
        if (it->second == -1) {
          amax(mx, a[it->first]);
        } else {
          g[i].push_back(it->second);
        }
      }
      leafmax[i] = mx;
      t.erase(left, right);
      t.insert(make_pair((l[i]), (i)));
    }
  }
  vector<vector<double> > dp(V, vector<double>(q * 2 + 1));
  for (int(ix) = 0; (ix) < (int)(sorted.size()); ++(ix)) {
    int i = sorted[ix].second;
    double pi = p[i];
    int mx = leafmax[i];
    for (int(j) = (int)(-q); (j) <= (int)(q); ++(j)) {
      double x = 1, y = 1;
      for (typeof((g[i]).begin()) k = ((g[i]).begin()); k != (g[i]).end();
           ++k) {
        x *= dp[*k][q + j];
        if (j - 1 >= -q) y *= dp[*k][q + j - 1];
      }
      if (mx > ma + j) x = 0;
      if (mx + 1 > ma + j) y = 0;
      double r = (1 - pi) * x + pi * y;
      dp[i][q + j] = r;
    }
  }
  double ans = 0;
  for (int(j) = (int)(0); (j) <= (int)(q); ++(j)) {
    double x = dp[q][q + j] - dp[q][q + j - 1];
    ans += x * (ma + j);
  }
  printf("%.10f\n", ans);
  return 0;
}
