#include <bits/stdc++.h>
using namespace std;
int n, q;
int a[100020];
int L[100020], R[100020];
double p[100020];
int ord[100020];
int stk[100020], top;
vector<int> adj[100020];
int mx[100020];
double dp[5020][5020];
bool cmp(int i, int j) {
  if (L[i] != L[j]) return L[i] < L[j];
  return R[i] > R[j];
}
void dfs(int u) {
  int lst = L[u];
  mx[u] = a[L[u]];
  for (int i = 0; i < adj[u].size(); ++i) {
    int v = adj[u][i];
    dfs(v);
    while (lst < L[v]) mx[u] = max(mx[u], a[lst++]);
    mx[u] = max(mx[u], mx[v]);
    lst = R[v] + 1;
  }
  while (lst <= R[u]) mx[u] = max(mx[u], a[lst++]);
  for (int i = 0; i <= q; ++i) {
    double pa = p[u], pb = 1 - pa;
    if (i == 0) pa = 0;
    for (int j = 0; j < adj[u].size(); ++j) {
      int v = adj[u][j];
      if (mx[u] + i - mx[v] - 1 < 0)
        pa = 0;
      else if (mx[u] + i - mx[v] - 1 <= q)
        pa *= dp[v][mx[u] + i - mx[v] - 1];
      if (mx[u] + i - mx[v] <= q) pb *= dp[v][mx[u] + i - mx[v]];
    }
    dp[u][i] = pa + pb;
  }
}
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 1; i <= q; ++i) {
    scanf("%d%d%lf", &L[i], &R[i], &p[i]);
  }
  ++q;
  L[q] = 1, R[q] = n, p[q] = 0;
  for (int i = 1; i <= q; ++i) ord[i] = i;
  sort(ord + 1, ord + q + 1, cmp);
  stk[top++] = ord[1];
  for (int i = 2; i <= q; ++i) {
    while (top && (R[stk[top - 1]] < L[ord[i]] || L[stk[top - 1]] > R[ord[i]]))
      --top;
    adj[stk[top - 1]].push_back(ord[i]);
    stk[top++] = ord[i];
  }
  dfs(ord[1]);
  double ans = mx[ord[1]] * dp[ord[1]][0];
  for (int i = 1; i <= q; ++i)
    ans += (dp[ord[1]][i] - dp[ord[1]][i - 1]) * (mx[ord[1]] + i);
  printf("%.12lf\n", ans);
  return 0;
}
