#include <bits/stdc++.h>
using namespace std;
struct seg {
  int l;
  int r;
  double p;
};
int n;
int a[110000];
int lg[110000];
int st[20][110000];
seg x[5100];
pair<int, int> x2[5100];
set<int> q, q2;
void build() {
  for (int i = 0; i <= n; i++)
    if (i > 1)
      lg[i] = lg[i / 2] + 1;
    else
      lg[i] = 0;
  for (int p = 0; (1 << p) <= n; p++) {
    for (int i = 0; i + (1 << p) <= n; i++) {
      if (p == 0)
        st[p][i] = a[i];
      else {
        st[p][i] = max(st[p - 1][i], st[p - 1][i + (1 << (p - 1))]);
      }
    }
  }
}
int get(int l, int r) {
  int p = lg[r - l + 1];
  return max(st[p][l], st[p][r - (1 << p) + 1]);
}
int froms[5010];
double p[5010][5010];
pair<double, double> tmp[5010];
pair<double, double> tmp2[5010];
double ans = 0;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.setf(ios::fixed);
  cout.precision(12);
  int m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) cin >> a[i];
  build();
  for (int i = 0; i < m; i++) {
    seg r;
    cin >> x[i].l >> x[i].r >> x[i].p;
    x2[i] = make_pair(x[i].r - x[i].l, i);
  }
  m++;
  x[m - 1].l = 1;
  x[m - 1].r = n;
  x[m - 1].p = 0;
  x2[m - 1] = make_pair(n - 1, m - 1);
  sort(x2, x2 + m);
  for (int i = 0; i < m; i++) {
    int ind = x2[i].second;
    int l = x[ind].l;
    int r = x[ind].r;
    int from = get(l - 1, r - 1);
    froms[ind] = from;
    double pp = x[ind].p;
    for (int j = 0; j <= 5001; j++) p[ind][j] = 0;
    p[ind][0] = 1;
    q2 = q;
    for (set<int>::iterator it = q.begin(); it != q.end(); it++)
      if (x[*it].l >= l && x[*it].r <= r) {
        for (int j = 0; j <= 5001; j++) {
          tmp[j] = make_pair(p[ind][j], 0.0);
          p[ind][j] = 0;
        }
        double sum = 1;
        for (int j = 0; j <= 5001; j++)
          if (froms[*it] + j >= from) {
            tmp[froms[*it] + j - from].second = p[*it][j];
            sum -= p[*it][j];
          }
        tmp2[0] = make_pair(0, sum);
        for (int j = 1; j <= 5001; j++) {
          tmp2[j].first = tmp2[j - 1].first + tmp[j - 1].first;
          tmp2[j].second = tmp2[j - 1].second + tmp[j - 1].second;
        }
        q2.erase(*it);
        for (int j = 0; j <= 5001; j++) {
          if (tmp[j].first != 0 || tmp[j].second != 0) {
            p[ind][j] += tmp[j].first * tmp[j].second +
                         tmp[j].first * tmp2[j].second +
                         tmp[j].second * tmp2[j].first;
          }
        }
      }
    q = q2;
    q.insert(x2[i].second);
    for (int j = 5001; j >= 0; j--)
      if (j)
        p[ind][j] = p[ind][j] * (1 - pp) + p[ind][j - 1] * (pp);
      else
        p[ind][j] = p[ind][j] * (1 - pp);
    ans = 0;
    if (i == m - 1)
      for (int j = 0; j <= 5001; j++)
        if (p[ind][j] > 0) {
          ans += (from + j) * p[ind][j];
        }
  }
  cout << ans << "\n";
  return 0;
}
