#include <bits/stdc++.h>
const int N = 1e5 + 5;
const int inf = 1e9 + 5001;
const double EPS = 1e-12;
using namespace std;
struct query {
  int l, r, id;
  double p;
  query(int l, int r, int id, double p) : l(l), r(r), id(id), p(p) {}
  bool operator<(const query& a) const {
    return ((r < a.r) || (r == a.r && l > a.l));
  }
};
vector<pair<int, double> > ans[5005];
vector<query> mv;
double res;
int n, q, Max[4 * N], a[N];
void init(int i, int l, int r) {
  if (l == r) {
    Max[i] = a[l];
    return;
  }
  int mid = (l + r) >> 1;
  init(i << 1, l, mid);
  init(i << 1 | 1, mid + 1, r);
  Max[i] = max(Max[i << 1], Max[i << 1 | 1]);
}
void update(int i, int l, int r, int L, int R) {
  if (L > r || l > R || Max[i] == 0) return;
  if (L <= l && r <= R) Max[i] = 0;
  if (l == r) return;
  int mid = (l + r) >> 1;
  update(i << 1, l, mid, L, R);
  update(i << 1 | 1, mid + 1, r, L, R);
  Max[i] = max(Max[i << 1], Max[i << 1 | 1]);
}
int get(int i, int l, int r, int L, int R) {
  if (L > r || l > R) return 0;
  if (L <= l && r <= R) return Max[i];
  int mid = (l + r) >> 1;
  return max(get(i << 1, l, mid, L, R), get(i << 1 | 1, mid + 1, r, L, R));
}
void Merge(vector<pair<int, double> >& a, vector<pair<int, double> >& b) {
  int cnt1 = 0, cnt2 = 0;
  double a1 = 0, a2 = 0;
  vector<pair<int, double> > ans;
  while (cnt1 < a.size() || cnt2 < b.size()) {
    pair<int, double> x =
        ((cnt1 < a.size()) ? a[cnt1] : pair<int, double>(inf, 0));
    pair<int, double> y =
        ((cnt2 < b.size()) ? b[cnt2] : pair<int, double>(inf, 0));
    if (x > y) {
      swap(x, y), cnt2++;
      a2 += x.second;
      x.second *= a1;
    } else {
      cnt1++;
      a1 += x.second;
      x.second *= a2;
    }
    if (ans.size() && ans.back().first == x.first)
      ans.back().second += x.second;
    else if (x.second > EPS)
      ans.push_back(x);
  }
  a = ans;
  b.clear();
}
void Merge_child(vector<pair<int, double> >& a, vector<pair<int, double> >& b) {
  int cur = a[0].first;
  double p = a[1].second;
  vector<pair<int, double> > ans;
  ans.push_back(pair<int, double>(cur, 1));
  Merge(b, ans);
  for (auto x : b) {
    pair<int, double> a = x, b = x;
    a.second *= 1 - p;
    b.first++;
    b.second *= p;
    if (ans.size() && ans.back().first == a.first)
      ans.back().second += a.second;
    else if (a.second > EPS)
      ans.push_back(a);
    if (b.second > EPS) ans.push_back(b);
  }
  a = ans;
  b.clear();
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) cin >> a[i];
  init(1, 1, n);
  for (int i = 1; i <= q; i++) {
    int l, r;
    double p;
    cin >> l >> r >> p;
    mv.push_back(query(l, r, i, p));
  }
  sort(mv.begin(), mv.end());
  mv.push_back(query(1, n, q + 1, 0));
  int cnt = 0;
  for (int i = 0; i < mv.size(); i++) {
    int id = mv[i].id, l = mv[i].l, r = mv[i].r, cur = get(1, 1, n, l, r);
    double p = mv[i].p;
    ans[id].push_back(pair<int, double>(cur, 1 - p));
    ans[id].push_back(pair<int, double>(cur + 1, p));
    if (cnt && l <= mv[cnt - 1].l) {
      vector<pair<int, double> > New;
      New.push_back(pair<int, double>(-1, 1));
      while (cnt && l <= mv[cnt - 1].l) {
        Merge(New, ans[mv[cnt - 1].id]);
        cnt--;
      }
      Merge_child(ans[id], New);
    }
    vector<pair<int, double> > New;
    for (auto x : ans[id])
      if (x.second > EPS) New.push_back(x);
    ans[id].swap(New);
    mv[cnt++] = mv[i];
    update(1, 1, n, l, r);
    res = 0;
  }
  for (auto x : ans[q + 1]) res += x.first * x.second;
  cout << fixed << setprecision(10) << res;
}
