Match the Range

Well, I will not waste your time and go straight to the problem.

You are given an array A of numbers. And some queries. Each query consists of two ranges. You need to find out if those two ranges are similar or not. You are given a function to figure out if two ranges are same or not.

This is a companion discussion topic for the original entry at