<div style="text-align: justify">
There is a sequence of integers $c_1, c_2, \ldots, c_k$. This sequence was hidden, by constructing a new sequence $b_1, b_2, \ldots, b_{k-1}$ according to the following rule: each element $b_i$ is equal to the sum of $c_i$ and $c_{i+1}$ (i.e., $b_i=c_i+c_{i+1}$) for all $i$ from $1$ to $k-1$.
Your task is to determine the maximum number of distinct numbers that can be in the original sequence $c_1, c_2, \ldots, c_k$, given the values of $b_1, b_2, \ldots, b_{k-1}$.
To make the task more challenging for reconstructing the sequence $c$, you receive an array $a_1, a_2, \ldots, a_n$. You need to process $m$ queries in the form of intervals $[l, r]$, where $l$ and $r$ are some indices of elements in the sequence $a$. For each query, you are required to determine the number of distinct numbers in the sequence $c$ if the sequence $b$ were equal to $a_l, a_{l+1}, \ldots, a_r$. </div>