#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2e5 + 5;
const int MAXM = 5005;
struct Node {
  int l, r, mx;
  double p;
  Node() = default;
  Node(int a, int b, int c, double d) : l(a), r(b), mx(c), p(d) {}
  inline bool operator<(const Node &x) const {
    return l == x.l ? r > x.r : l < x.l;
  }
} q[MAXM];
vector<int> v[MAXM];
int n, m, lg[MAXN], st[19][MAXN];
double f[MAXM][MAXM];
inline int read() {
  int x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x;
}
inline void prepare() {
  for (int i = 2; i <= n; i++) lg[i] = lg[i >> 1] + 1;
}
inline int query(int l, int r) {
  int len = lg[r - l + 1];
  return max(st[len][l], st[len][r - (1 << len) + 1]);
}
void dfs(int x) {
  double tmp = 1;
  for (auto y : v[x]) dfs(y);
  for (auto y : v[x]) tmp *= f[y][q[x].mx - q[y].mx];
  f[x][0] = (1 - q[x].p) * tmp;
  for (int i = 1; i <= m; i++) {
    double p1 = 1, p2 = 1;
    for (auto y : v[x]) {
      p1 *= f[y][min(q[x].mx + i - q[y].mx - 1, m)];
      p2 *= f[y][min(q[x].mx + i - q[y].mx, m)];
    }
    f[x][i] = q[x].p * p1 + (1 - q[x].p) * p2;
  }
}
int main() {
  n = read(), m = read(), prepare();
  for (int i = 1; i <= n; i++) st[0][i] = read();
  for (int j = 1; j <= 17; j++)
    for (int i = 1; i + (1 << j) - 1 <= n; i++)
      st[j][i] = max(st[j - 1][i], st[j - 1][i + (1 << (j - 1))]);
  for (int i = 1; i <= m; i++) {
    int x = read(), y = read();
    double p;
    scanf("%lf", &p);
    q[i] = Node(x, y, query(x, y), p);
  }
  q[++m] = Node(1, n, query(1, n), 0);
  sort(q + 1, q + m + 1);
  for (int i = 2; i <= m; i++)
    for (int j = i - 1; j; j--)
      if (q[j].l <= q[i].l && q[i].r <= q[j].r) {
        v[j].push_back(i);
        break;
      }
  dfs(1);
  double ans = f[1][0] * q[1].mx;
  for (int i = 1; i <= m; i++) ans += (f[1][i] - f[1][i - 1]) * (q[1].mx + i);
  printf("%.9lf\n", ans);
  return 0;
}
