John Doe invented a nice way to measure distance between two arrays of different length. Let a_1,…,a_l_1 be the first array and b_1,…,b_l_2 be the second one. Then d(a,b)=∑_i=1l_1∑_j=1l_2∣a_i−b_j∣. Unfortunately, this distance function does not satisfy the triangle inequality, but John decided to conduct a few experiments anyway.
John has a large array a_1,…,a_n. He would like to know the values d((a_l_1,a_l_1+1,…,a_r_1),(a_l_2,a_l_2+1,…,a_r_2)) for q instances of values (l_1,r_1,l_2,r_2). Help him find these values.
The first line contains two integers n and q: the number of elements in the array and the number of queries (1≤n,q≤105). The second line contains n integers a_1,…,a_n: the elements of John's large array (0≤a_i≤108). The next q lines contain four integers each: l_1, r_1, l_2, r_2, which are the parameters of the respective query (1≤l_1≤r_1≤n, 1≤l_2≤r_2≤n).
For each query, print the value of d((a_l_1,a_l_1+1,…,a_r_1),(a_l_2,a_l_2+1,…,a_r_2)).