#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5;
const int maxq = 5120;
const int INF = 1e9 + 9;
struct SegmentTree {
  int n, sz;
  int t[maxn * 4];
  int left(const int &i) { return i << 1; }
  int right(const int &i) { return (i << 1) + 1; }
  void recalc(const int &i) {
    if (i > sz) return;
    t[i] = max(t[left(i)], t[right(i)]);
  }
  void init(int _n, int *a) {
    n = _n;
    for (sz = 1; sz < n; sz <<= 1)
      ;
    --sz;
    for (int i = int(1); i <= int(_n); ++i) t[i + sz] = a[i];
    for (int i = int(sz); i >= int(1); --i) recalc(i);
  }
  int get_max(int l, int r) {
    l += sz, r += sz;
    int ans = -INF;
    while (l <= r) {
      if (l & 1) ans = max(ans, t[l]);
      if (!(r & 1)) ans = max(ans, t[r]);
      l = (l + 1) >> 1, r = (r - 1) >> 1;
    }
    return ans;
  }
} s_tree;
struct query {
  int l, r, mx;
  double p;
  query() {}
  query(int l, int r, double p) : l(l), r(r), p(p) {}
  bool operator<(const query &b) const {
    if (l != b.l) return l < b.l;
    if (r != b.r) return r > b.r;
    return p < b.p;
  }
  void out() { cout << l << " " << r << " " << p << "\n"; }
} qs[maxq];
int n, q;
int a[maxn];
vector<int> v[maxq];
void build_tree() {
  for (int i = int(1); i <= int(q); ++i) {
    for (int j = int(i - 1); j >= int(1); --j) {
      if (qs[j].l <= qs[i].l && qs[i].r <= qs[j].r) {
        v[j].push_back(i);
        break;
      }
    }
  }
}
void build_max() {
  s_tree.init(n, a);
  for (int i = int(1); i <= int(q); ++i)
    qs[i].mx = s_tree.get_max(qs[i].l, qs[i].r);
}
bool u[maxq][maxq];
double d[maxq][maxq];
double dp(const int &x, const long long &add) {
  if (add > q) return 1;
  if (add < 0) return 0;
  if (u[x][add]) return d[x][add];
  u[x][add] = 1;
  long long cur_max = qs[x].mx;
  double prob = qs[x].p;
  double inc = prob, no_inc = (1.0 - prob);
  for (int i = int(0); i <= int(v[x].size() - 1); ++i) {
    int to = v[x][i];
    inc *= dp(to, (cur_max + add) - qs[to].mx - 1);
    no_inc *= dp(to, (cur_max + add) - qs[to].mx);
  }
  d[x][add] = (add > 0 ? inc : 0) + no_inc;
  return d[x][add];
}
double ans;
int l, r;
double p;
int main() {
  cerr << fixed;
  cerr.precision(3);
  ios_base ::sync_with_stdio(0);
  cin >> n >> q;
  for (int i = int(1); i <= int(n); ++i) cin >> a[i];
  for (int i = int(1); i <= int(q); ++i) {
    cin >> l >> r >> p;
    qs[i] = query(l, r, p);
  }
  qs[++q] = query(1, n, 0);
  sort(qs + 1, qs + 1 + q);
  build_tree();
  build_max();
  cout << fixed;
  cout.precision(7);
  ans = dp(1, 0) * qs[1].mx;
  for (int i = int(1); i <= int(q); ++i) {
    ans += (dp(1, i) - dp(1, i - 1)) * (qs[1].mx + i);
    if (dp(1, i) < dp(1, i - 1)) {
      qs[1].out();
      qs[2].out();
      qs[3].out();
      qs[4].out();
      qs[5].out();
      cout << i << " " << dp(1, i) << " " << dp(1, i - 1) << "\n";
      return 0;
    }
  }
  cout << ans << "\n";
  return 0;
}
