Yaroslav has an array p = p 1, p 2, ..., p n (1 ≤ p i ≤ n), consisting of n distinct integers. Also, he has m queries: Query number i is represented as a pair of integers l i , r i (1 ≤ l i ≤ r i ≤ n). The answer to the query l i , r i is the number of pairs of integers q , w (l i ≤ q, w ≤ r i ) such that p q is the divisor of p w . Help Yaroslav, answer all his queries.
输入描述:
The first line contains the integers n and m(1 ≤ n, m ≤ 2·105). The second line contains n distinct integers p1, p2, ..., pn(1 ≤ pi ≤ n). The following m lines contain Yaroslav's queries. The i-th line contains integers li, ri(1 ≤ li ≤ ri ≤ n).


输出描述:
Print m integers — the answers to Yaroslav's queries in the order they appear in the input.Please, do not use the %lld specifier to read or write 64-bit integers in C++. It is preferred to use the cin, cout streams or the %I64d specifier.
示例1

输入

1 1<br />1<br />1 1<br />10 9<br />1 2 3 4 5 6 7 8 9 10<br />1 10<br />2 9<br />3 8<br />4 7<br />5 6<br />2 2<br />9 10<br />5 10<br />4 10<br />

输出

1<br />27<br />14<br />8<br />4<br />2<br />1<br />2<br />7<br />9<br />
加载中...