Suppose, there is an array of integers. Each index of the array is either red or green. The first index is red, then the following is green, then the very next one is again red, then green again and the pattern will be like this.
You are given m queries and each query contains , integers. Your task is to find out the number of red and green lie between the range and (inclusive).
The first line of the input contains an integer () indicates the testcase. Following lines there will be two integers (), () indicates the size of array and the number of query respectively. The index will be 1, 2, ..., n. Then lines follows two integers , () respectively.
For each query print two integers and , the total number of red and green in the range. There is a space between and and don't forget to print new line after each query.
Input | Output |
---|---|
2 5 2 1 3 1 5 10 4 5 5 2 9 4 8 1 10 | 2 1 3 2 1 0 4 4 2 3 5 5 |