For this Question: Given an array of N integers,. There are several right circular rotations of range [L. R] that you need to perform. After performing these rotations, you need to find element at a given index X.First line of input contains size of array N and the given index X.
The second line of input contains N space separated integers.
The third line contains number of ranges M for right circular rotations, next M lines contains two space space separated integers containing values of Li Ri.

Constrains:-
1 < = X < = N < = 100000
1 < = A[i] < = 100000
1 < = M < = 100000
1 < = L < = R < = NPrint the element present at the given X.Sample Input:-
5 2
1 2 3 4 5
2
1 3
1 4

Sample Output:-
3

Explanation:-
After first given rotation (1 3)
 arr[] = {3, 1, 2, 4, 5}
 After second rotation (1, 4) 
 arr[] = {4, 3, 1, 2, 5}
After all rotations we have element 3 at given index 2., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;

// Function to compute the element at
// given index
int findElement(int arr[], int ranges[][2],
               int rotations, int index)
{
    for (int i = rotations - 1; i >= 0; i--) {

        // Range[left...right]
        int left = ranges[i][0];
        int right = ranges[i][1];

        // Rotation will not have any effect
        if (left <= index && right >= index) {
            if (index == left)
                index = right;
            else
                index--;
        }
    }

    // Returning new element
    return arr[index];
}

// Driver
int main()
{

  int n,x;
  cin>>n>>x;
  int a[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  x--;
int m;
cin>>m;
int rot[m][2];
for(int i=0;i<m;i++){
    cin>>rot[i][0]>>rot[i][1];
    rot[i][0]--;
    rot[i][1]--;
}

    cout << findElement(a, rot, m, x);

    return 0;

}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?