#include <bits/stdc++.h>
using namespace std;
struct Rec {
  int l;
  int r;
  double p;
  int mx;
  Rec() : l(0), r(0), p(0), mx(0){};
  Rec(int l, int r, double p, int mx) : l(l), r(r), p(p), mx(mx){};
  int length() const { return r - l + 1; }
  bool operator<(const Rec &rhs) const {
    if (length() == rhs.length()) return p > rhs.p;
    return length() < rhs.length();
  }
  bool inside(const Rec &rhs) const { return l >= rhs.l && r <= rhs.r; }
};
struct MaxTree {
  static int const shift = 131072;
  vector<int> values;
  MaxTree() : values(2 * shift + 1) {}
  void update(int i, int val) {
    i += shift;
    values[i] = val;
    i /= 2;
    while (i > 0) {
      values[i] = max(values[2 * i], values[2 * i + 1]);
      i /= 2;
    }
  }
  int getMax(int l, int r) {
    l += shift;
    r += shift;
    int result = 0;
    while (l <= r) {
      if (l % 2 == 1) result = max(result, values[l]);
      if (r % 2 == 0) result = max(result, values[r]);
      l = (l + 1) / 2;
      r = (r - 1) / 2;
    }
    return result;
  }
};
vector<vector<int>> adj;
vector<vector<double>> memo;
vector<Rec> recs;
double calca(int i, int j) {
  if (j >= ((int)(recs).size())) return 1.0;
  if (j < 0) return 0.0;
  if (memo[i][j] != -1) return memo[i][j];
  double result = 0;
  double p = 1 - recs[i].p;
  for (int ch : adj[i]) p *= calca(ch, recs[i].mx - recs[ch].mx + j);
  result += p;
  if (j > 0) {
    double p = recs[i].p;
    for (int ch : adj[i]) p *= calca(ch, recs[i].mx - recs[ch].mx + j - 1);
    result += p;
  }
  memo[i][j] = result;
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, q;
  cin >> n >> q;
  vector<int> a(n + 1);
  for (int i = 1; i <= n; ++i) cin >> a[i];
  MaxTree maxTree;
  for (int i = 1; i <= n; ++i) maxTree.update(i, a[i]);
  recs = vector<Rec>(q);
  for (int i = 0; i < q; ++i) {
    cin >> recs[i].l >> recs[i].r >> recs[i].p;
    recs[i].mx = maxTree.getMax(recs[i].l, recs[i].r);
  }
  recs.push_back(Rec(1, n, 0, maxTree.getMax(1, n)));
  sort(recs.rbegin(), recs.rend());
  adj = vector<vector<int>>(((int)(recs).size()));
  for (int i = 0; i < ((int)(recs).size()); ++i) {
    for (int j = i - 1; j >= 0; --j)
      if (recs[i].inside(recs[j])) {
        adj[j].push_back(i);
        break;
      }
  }
  memo = vector<vector<double>>(((int)(recs).size()));
  for (int i = 0; i < ((int)(recs).size()); ++i)
    memo[i] = vector<double>(((int)(recs).size()) + 1, -1);
  double result = calca(0, 0) * recs[0].mx;
  for (int j = 1; j <= q; ++j)
    result += (calca(0, j) - calca(0, j - 1)) * (recs[0].mx + j);
  cout << fixed << setprecision(10) << result << endl;
  return 0;
}
