{"trustable":false,"sections":[{"title":"Background","value":{"format":"MD","content":"周神是codeforces的加分员,前几天的比赛打完,周神就帮参加比赛的人进行了加分和减分,但是周神总感觉不对劲。\n"}},{"title":"Description","value":{"format":"MD","content":"周神看了一下才发现有很多人都少加了分和少减了分,你能帮帮他快速加完分吗?\n"}},{"title":"Input","value":{"format":"MD","content":"第一行有两个整数 $n$,$p$,代表参加人数与增加分数的次数。\n\n第二行有 $n$ 个数,$a_1 \\sim a_n$,代表各个人的初始分。\n\n接下来 $p$ 行,每行有三个数,$x$,$y$,$z$,代表给第 $x$ 个到第 $y$ 个码农每人增加 $z$ 分( $z$ 是负数的话那就是减分)。"}},{"title":"Output","value":{"format":"MD","content":"输出仅一行,代表更改分数后,输出加完分之后的分数倒数第一名的分数。\n"}},{"title":"Sample 1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3 2\n1 1 1\n1 2 1\n2 3 1\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"MD","content":"对于 $40\\%$ 的数据,有 $n \\le 10^3$。\n\n对于 $60\\%$ 的数据,有 $n \\le 10^4$。\n\n对于 $80\\%$ 的数据,有 $n \\le 10^5$。\n\n对于 $100\\%$ 的数据,有 $n \\le 5\\times 10^6$,$p \\le n$,码农初始成绩 $ \\le 100$,$z \\le 100$。"}}]}