you are given an array a containing n distinct integers you are also given q queries of the form