You are a car race organizer and would like to arrange some races in Linear Kingdom.

Linear Kingdom has *n* consecutive roads spanning from left to right. The roads are numbered from 1 to *n* from left to right, thus the roads follow in the order of their numbers' increasing. There will be several races that may be held on these roads. Each race will use a consecutive subset of these roads. Also, each race will pay some amount of money to you if this race is held. No races overlap in time, so some roads can be used in several races.

Unfortunately, some of the roads are in a bad condition and they need repair. Each road has repair costs associated with it, you are required to pay this cost to repair the road. A race can only take place if all the roads used in the race are renovated. Your task is to repair such roads (possibly all or none) that will maximize your profit. Your profit is defined as the total money you get from the races that are held minus the total money you spent to repair the roads. Note that you may decide not to repair any road and gain zero profit.

Print the maximum profit you can gain.
The first line contains two single-space separated integers, *n* and *m* (1 ≤ *n*, *m* ≤ 2·10<sup class="upper-index">5</sup>), denoting the number of roads and the number of races, respectively.

Then *n* lines follow, each line will contain a single non-negative integer not exceeding 10<sup class="upper-index">9</sup> denoting the cost to repair a road. The costs are given in order from road 1 to road *n*.

Finally, *m* lines follow. Each line is single-space-separated triplets of integers. Each triplet will be given as *lb*, *ub*, and *p* (1 ≤ *lb* ≤ *ub* ≤ *n*, 1 ≤ *p* ≤ 10<sup class="upper-index">9</sup>), which means that the race these three integers describe will use all the roads from *lb* to *ub*, inclusive, and if it's held you get *p*.
7 4
3
2
3
2
1
2
3
1 2 5
2 3 5
3 5 3
7 7 5
4
2 1
0
3
1 2 5
2
3 1
10
10
10
1 3 10
0
3 2
10
10
12
1 2 25
2 3 5
5
7 5
1
2
3
0
5
6
7
1 3 3
1 2 3
1 1 3
4 6 15
7 7 4
7
5 5
0
0
0
0
0
1 1 1000000000
2 2 1000000000
3 3 1000000000
4 4 1000000000
5 5 1000000000
5000000000
3 2
3
8
3
1 2 10
2 3 10
6
10 8
33930500
249890727
553757132
571301286
535990315
433808986
428745197
461561455
355416641
127410873
1 10 419764974
3 9 229470163
3 10 291232092
2 10 483262264
3 5 561890379
6 8 333274969
2 9 762222268
2 9 731460943
60764940
1 1
1
1 1 2
1
5 3
1
0
0
2
0
3 4 5
3 4 1
1 3 3
6
10 8
212749027
472287218
528909998
592722741
656413986
521299317
454014903
356019417
201615821
190915667
3 7 194993664
2 10 654414593
1 5 318407622
4 9 78092496
6 10 710430585
2 8 717871540
1 5 618048353
2 6 354310856
0
11 8
2
0
0
0
11
2
9
7
9
4
3
1 1 6
5 5 9
5 5 6
3 11 7
6 11 4
6 11 3
2 10 6
5 9 9
8
10 10
0
8
6
9
3
6
5
0
4
6
5 9 9
1 7 10
2 4 1
2 10 3
4 7 9
1 4 2
5 10 2
2 7 7
6 7 3
8 9 10
10
10 10
3
4
10
0
5
1
4
6
0
4
6 6 8
5 10 5
1 6 7
1 7 4
3 5 8
6 6 7
8 10 10
1 4 10
2 9 9
3 7 8
39
5 5
4
2
4
2
4
1 5 4
1 5 3
3 5 3
4 5 5
4 5 2
1
3 3
2
3
0
1 3 3
1 3 1
1 2 2
1
10 20
0
4
12
14
2
7
3
7
0
0
3 4 3
4 7 1
6 9 5
3 6 7
5 9 10
3 9 2
2 10 13
7 9 12
9 9 3
1 4 2
3 5 8
7 8 13
4 10 8
2 6 6
4 10 1
7 7 14
1 9 14
7 7 15
8 9 10
5 5 11
109
print("_RANDOM_GUESS_1689436835.0632403")# 1689436835.0632606