Green Street is a street with $$$N$$$ blocks labeled from $$$1$$$ to $$$N$$$, and block $$$i$$$ has $$$T_i$$$ trees on the block. Clare goes on $$$M$$$ walks labeled from $$$1$$$ to $$$M$$$, and walk $$$i$$$ is between blocks $$$A_i$$$ and $$$B_i$$$ inclusive. How many trees does Clare walk past?
Line $$$1$$$: Two space separated integers $$$N$$$ ($$$1 \le N \le 200$$$) and $$$M$$$ ($$$1 \le M \le 10^4$$$).
Line $$$2$$$: $$$N$$$ space separated integers $$$T_i$$$ ($$$1 \le T_i \le 20$$$).
Lines $$$3...M+2$$$: Two space separated integers $$$A_i$$$ and $$$B_i$$$ ($$$1 \le A_i, B_i \le N$$$).
Line $$$1$$$: The number of trees Clare walks past.
4 2 2 1 6 1 1 2 2 4
11
$$$1 \le N \le 200$$$
$$$1 \le M \le 10^4$$$
$$$1 \le T_i \le 20$$$
$$$1 \le A_i, B_i \le N$$$
| Name |
|---|


