For this Question: Given an integer array A of size N. Find the sum of GCD (Greatest Common Divisor) of all elements with their frequency.First line contains an integers N.
Next line contains N space separated integers denoting elements of array.

Constraints
1 <= N <= 1000
0 <= Ai<= 10^5Print the sum of GCD of all elements with their frequency.Sample Input 1:
3
1 2 3

Output 
3

Explanation:
gcd(1, 1) + gcd(2, 1) + gcd(3, 1) = 1+1+1 = 3

Sample Input 2:
6
3 6 6 9 3 3

Output 
14

Explanation
gcd(3, 3) + gcd(6, 2) + gcd(6, 2) + gcd(9, 1) + gcd(3, 3) + gcd(3, 3)= 3+2+2+1+3+3= 14, I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;
#define endl            "\n"
#define ll				long long int
#define f(n) 			for(int i=0;i<n;i++)
#define fo(n)			for(int j=0;j<n;j++)
#define foo(n)			for(int i=1;i<=n;i++)
#define ff 				first
#define ss 				second
#define pb 				push_back
#define pii 			pair<int,int>
#define vi 				vector<int>
#define vp 				vector<pii>
#define test            int tt; cin>>tt; while(tt--)
#define mod 			1000000007
void fastio()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("Input 1.txt", "r", stdin);
	freopen("Output 1.txt", "w", stdout);
#endif
}

int main() {
	fastio();
	int n;
	cin >> n;
	int a[n];
	f(n)cin >> a[i];
	map<int, int>m;
	int sum = 0;
	f(n) {
		m[a[i]]++;
	}
	f(n) {
		sum += __gcd(a[i], m[a[i]]);
	}
	cout << sum << endl;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?