Moloco is an ad-tech company in KAIST city which can be described as a 1-dimensional line. There are N branches in Moloco, and the sales territory of the ith branch is range \[l_i,r_i]. Also it is known that l_i<r_i for 1≤i≤N and r_i≤l_i+1 for 1≤i≤N−1.
Moloco defines two branches to intersect if there exists a point which is included in both branches' sales territory. For example \[3,5] and \[5,7] intersect, \[1,4] and \[2,5] intersect while \[1,2] and \[3,5] does not.
Moloco can widen the whole branch's sales territory by efficient advertisement. If Moloco spends K won, then every branch may widen its sales territory by at most K length units. Start and end of widened sales territory should have integer value.
Formally, let the new sales territory of ith branch be \[l_i′,r_i′]. Below conditions should satisfy.
Since too many branches cause difficulty in company management, Moloco is trying to merge all branches into one. Two branch can be merged if they intersect. The sales territory of the new branch will be the union of sales territories of two branches.

Fig 1. Illustration of sample 1 when K=4
You are employed to Moloco. You are curious of hypothetical scenarios when Moloco only owns sth to eth branches. For each of these scenarios, you want to find the minimum cost to merge the branches owned by Moloco. Given Q queries where Moloco only owns sth to eth branches, solve the minimum cost to merge all branches into one.
First line contains two integers N, Q (1≤N≤5000,1≤Q≤106).
N lines follow. i-th line contains two integers l_i, r_i (1≤l_i<r_i≤109), denoting the sales territory of ith branch. Additionaly, r_i≤l_i+1 for all 1≤i≤N−1.
Q lines follow. i-th line contains two integers s_i, e_i (1≤s_i≤e_i≤N), denoting the ith query.
Print Q lines. On the ith line, print the answer to the ith query, the minimum cost to merge all branches from s_i-th to e_i-th.
Notice that you don't need any cost if there is only one branch.