Given an integer $$$n$$$, the next line contains $$$n$$$ integer. Third line contains an integer $$$q$$$. The next $$$q$$$ lines, contains $$$q$$$ queries. Query format is $$$l_i$$$, $$$r_i$$$. You have to answer to queries like this. If all the numbers that are bigger than its index, that is, $$$a_l$$$ $$$ \gt =$$$ $$$0$$$, $$$a_{l + 1}$$$ $$$ \gt =$$$ $$$1$$$, $$${...}$$$, $$$a_r$$$ $$$ \gt =$$$ $$${r - l}$$$.
Can you help me to solve this problem?



