#include <bits/stdc++.h>
using namespace std;
#define ar array
#define ll long long
const int inf = 2e9;
const ll linf = 1e18;
void solve() {
int n, q;
cin >> n >> q;
vector<ll> a(n + 1);
for (int i = 1; i <= n;i++)
cin >> a[i];
while (q--) {
int l, r, x;
cin >> l >> r >> x;
for (int i = l; i <= r; i++)
a[i] += x;
vector<ll> dp(n + 1, -linf);
dp[0] = 0;
for (int i = 1; i <= n;i++) {
ll mx = a[i], mn = a[i];
for (int j = i - 1; j >= 0;j--) {
dp[i] = max(dp[i], mx - mn + dp[j]);
mx = max(mx, a[j]);
mn = min(mn, a[j]);
}
}
cout << dp[n] << "\n";
}
}
int32_t main() {
#ifdef Behruz
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
ios :: sync_with_stdio(false);
cin.tie(nullptr);
cout.tie(nullptr);
solve();
return 0;
}