In a quaint village, there lived a mathematician named Alice. One day, the villagers approached her with a unique challenge. They had an array of size , that held the secrets of their village, and they needed answers to their questions. These questions came in the form of queries.
Each query was a request for enlightenment, presented with four mysterious numbers - , , , and . For each query, Alice embarked on a journey through the array, focusing on the range from to . She carefully counted how many times each number appeared in this range (from L to R).
With this newfound knowledge, she weaved a tapestry of wisdom in the form of a new array, . For every from to :
If none of the elements in the range from to occurred times, she simply set .
Finally, Alice presented the villagers with the answer to their query, which was nothing short of a revelation. The answer for each query was the sum of the elements in her array , but only from position to , for the villagers believed that these specific positions held the key to their query's solution.
You now have to help Alice in completing this challenge.
Input format
Output format
For each test case, print the answer for each query in a new line.
Constraints
The first line denotes T = 1.
For test case :
Now,