For this Question: Given an array of N elements, your task is to find the count of repeated elements. Print the repeated elements in ascending order along with their frequency.
Have a look at the example for more understanding.The first line of input contains a single integer N, the next line of input contains N space- separated integers depicting the values of the array.

Constraints:-
1 <= N <= 100000
1 <= Arr[i] <= 100000For each duplicate element in sorted order in a new line, First, print the duplicate element and then print its number of occurence space- separated.

Note:- It is guaranteed that at least one duplicate element will exist in the given array.Sample Input:-
5
3 2 1 1 2

Sample Output:-
1 2
2 2

Sample Input:-
5
1 1 1 1 5

Sample Output:-
1 4

Explaination:
test 1: Only 1 and 2 are repeated. Both are repeated twice. So, we print:
1 -> frequency of 1
2 -> frequency of 2
1 is printed before 2 as it is smaller than 2, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define int long long
signed main(){

    int n;
    cin>>n;
    int a[n];
    map<int,int> m;
    for(int i=0;i<n;i++){
        cin>>a[i];
        m[a[i]]++;
        }
        for(auto it = m.begin();it!=m.end();it++){
            if(it->second>1){
                cout<<it->first<<" "<<it->second<<'\n';
            }
        }

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