Problem Description
Mr. Cui is working offcampus and he misses his girl friend very much. After a whole night tossing and turning, he decides to get to his girl friend’s city and of course, with wellchosen gifts. He knows neither too low the price could a gift be since his girl friend won’t like it, nor too high of it since he might consider not worth to do. So he will only buy gifts whose price is between $[a,b]$.
There are n cities in the country and $(n1)$ $b_i$directional roads. Each city can be reached from any other city. In the ith city, there is a specialty of price ci Cui could buy as a gift. Cui buy at most 1 gift in a city. Cui starts his trip from city s and his girl friend is in city t. As mentioned above, Cui is so hurry that he will choose the quickest way to his girl friend(in other words, he won’t pass a city twice) and of course, buy as many as gifts as possible. Now he wants to know, how much money does he need to prepare for all the gifts?
Input
There are multiple cases.
For each case:
The first line contains tow integers n,m( $1≤n,m≤10^5$ ), representing the number of cities and the number of situations.
The second line contains n integers $C_1$,$C_2$,…,$C_n$( $1≤C_i≤10^9$), indicating the price of city i’s specialty.
Then n1 lines follows. Each line has two integers $x$,$y$($1≤x,y≤n$), meaning there is road between city $x$ and city $y$.
Next m line follows. In each line there are four integers $s,t,a,b$($1≤s,t≤n$;$1≤a≤b≤10^9$), which indicates start city, end city, lower bound of the price, upper bound of the price, respectively, as the exact meaning mentioned in the description above
Output
Output m spaceseparated integers in one line, and the ith number should be the answer to the ith situation.
Sample Input
1  5 3 
Sample Output
1  7 1 4 
题目大意
给一棵树，每次问某两点之间的最短路径上，能够满足价格在 $[a,b]$ 这个范围内的价值之和是多少。
题解
求 $[a,b]$ 这个范围内的价值和相当于求 $[0,b]$ 的价值和减去 $[0,a1]$的价值和
然后所有的修改离线掉,按从小到大的顺序加进去了,然后求解
1 
