题号:NC256176
时间限制:C/C++/Rust/Pascal 6秒,其他语言12秒
空间限制:C/C++/Rust/Pascal 1024 M,其他语言2048 M
64bit IO Format: %lld
题目描述
Follow zaozijie Meow, follow zaozijie Thank you Meow.
Given a sequence of integers

, you need to answer

questions.
The answer to a
question 
is the amount of
)
s.t.

.

输入描述:
The first line contains two integers
.
The next line contains
integers
.
For the next
lines, each line contains two integers
, means a question.
输出描述:
For each question, output a line containing a single integer representing the answer.
示例1
输入
复制
10 5
9 8 5 4 5 1 5 1 5 8
2 8
4 9
7 9
6 7
2 3