CF220B Little Elephant and Array
Description
The Little Elephant loves playing with arrays. He has array $ a $ , consisting of $ n $ positive integers, indexed from 1 to $ n $ . Let's denote the number with index $ i $ as $ a_{i} $ .
Additionally the Little Elephant has $ m $ queries to the array, each query is characterised by a pair of integers $ l_{j} $ and $ r_{j} $ $ (1
Input Format
The first line contains two space-separated integers $ n $ and $ m $ $ (1
Output Format
In $ m $ lines print $ m $ integers — the answers to the queries. The $ j $ -th line should contain the answer to the $ j $ -th query.