#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int ar[100005];
int l[5005], r[5005];
double p[5005];
vector<int> adj[5005];
vector<pair<int, double> > ds[5005];
set<int> rem;
void push(vector<pair<int, double> > tmp[], int node) {
  ds[node].clear();
  int p[2] = {0, 0};
  while (p[0] < tmp[0].size() && p[1] < tmp[1].size()) {
    if (tmp[0][p[0]].first <= tmp[1][p[1]].first) {
      if (ds[node].size() > 0 && ds[node].back().first == tmp[0][p[0]].first) {
        ds[node].back().second += tmp[0][p[0]++].second;
      } else {
        ds[node].push_back(tmp[0][p[0]++]);
      }
    } else {
      if (ds[node].size() > 0 && ds[node].back().first == tmp[1][p[1]].first) {
        ds[node].back().second += tmp[1][p[1]++].second;
      } else {
        ds[node].push_back(tmp[1][p[1]++]);
      }
    }
  }
  while (p[0] < tmp[0].size()) {
    if (ds[node].size() > 0 && ds[node].back().first == tmp[0][p[0]].first) {
      ds[node].back().second += tmp[0][p[0]++].second;
    } else {
      ds[node].push_back(tmp[0][p[0]++]);
    }
  }
  while (p[1] < tmp[1].size()) {
    if (ds[node].size() > 0 && ds[node].back().first == tmp[1][p[1]].first) {
      ds[node].back().second += tmp[1][p[1]++].second;
    } else {
      ds[node].push_back(tmp[1][p[1]++]);
    }
  }
}
bool vis[5005];
const double eps = 1e-13;
void dfs(int node) {
  assert(!vis[node]);
  vis[node] = true;
  for (int ch : adj[node]) {
    dfs(ch);
  }
  int maxValue = 0;
  while (true) {
    set<int>::iterator it = rem.lower_bound(l[node]);
    if (it == rem.end() || *it > r[node]) {
      break;
    }
    maxValue = max(maxValue, ar[*it]);
    rem.erase(it);
  }
  vector<pair<int, double> > tmp[2];
  ds[node].push_back({maxValue, 1.0});
  for (int ch : adj[node]) {
    tmp[0].clear(), tmp[1].clear();
    double sum = 0;
    int pos = 0;
    for (int i = 0; i < ds[ch].size(); ++i) {
      while (pos < ds[node].size()) {
        if (ds[node][pos].first < ds[ch][i].first) {
          sum += ds[node][pos].second;
          ++pos;
        } else {
          break;
        }
      }
      if (pos != 0) tmp[0].push_back({ds[ch][i].first, ds[ch][i].second * sum});
    }
    sum = 0;
    pos = 0;
    for (int i = 0; i < ds[node].size(); ++i) {
      while (pos < ds[ch].size()) {
        if (ds[ch][pos].first <= ds[node][i].first) {
          sum += ds[ch][pos].second;
          ++pos;
        } else {
          break;
        }
      }
      if (pos != 0)
        tmp[1].push_back({ds[node][i].first, ds[node][i].second * sum});
    }
    ds[ch].clear();
    push(tmp, node);
  }
  tmp[0].clear();
  tmp[1].clear();
  for (int i = 0; i < ds[node].size(); ++i) {
    if (p[node] != 0)
      tmp[0].push_back({ds[node][i].first + 1, ds[node][i].second * p[node]});
    tmp[1].push_back({ds[node][i].first, ds[node][i].second * (1.0 - p[node])});
  }
  push(tmp, node);
}
int myParent[5005];
bool isAnc(int x, int y) {
  if (l[x] == l[y] && r[y] == r[x]) {
    if (y < x) {
      return true;
    } else {
      return false;
    }
  }
  if (l[y] <= l[x] && r[x] <= r[y]) {
    return true;
  }
  return false;
}
void solve() {
  int n, q;
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &ar[i]);
  }
  for (int i = 0; i <= q; ++i) {
    myParent[i] = -1;
  }
  for (int i = 1; i <= n; ++i) {
    rem.insert(i);
  }
  l[0] = 1, r[0] = n, p[0] = 0.0;
  for (int i = 1; i <= q; ++i) {
    scanf("%d %d %lf", &l[i], &r[i], &p[i]);
  }
  for (int i = 0; i <= q; ++i) {
    for (int j = 0; j <= q; ++j) {
      if (i != j) {
        if (isAnc(j, i) == 1) {
          if (myParent[j] == -1) {
            myParent[j] = i;
          } else {
            if (isAnc(i, myParent[j])) {
              myParent[j] = i;
            }
          }
        }
      }
    }
  }
  for (int i = 1; i <= q; ++i) {
    assert(myParent[i] != -1);
    adj[myParent[i]].push_back(i);
  }
  int root = 0;
  dfs(root);
  double exp = 0;
  for (int i = 0; i < ds[root].size(); ++i) {
    exp += ds[root][i].first * ds[root][i].second;
  }
  printf("%0.9lf\n", exp);
}
int main() {
  solve();
  return 0;
}
