For this Question: Given an array of N integers, your task is to calculate the sum of bit difference in all pairs which can be formed.The first line of input contains a single integer N, the second line of input contains N space separated integers depicting values of the array.

Constraints:-
1 <= N <= 100000
0 <= Arr[i] <= 1000000000Print the sum of bit difference of all possible pairs.

Note:- Since the answer can be quite large print your answer modulo 10<sup>9</sup> + 7Sample Input:-
2
1 3

Sample Output:-
2

Explanation:-
(1, 1) = 0
(1, 3) = 1
(3, 1) = 1
(3, 3) = 0

Sample Input:-
2
1 2

Sample Output:-
4, I have written this Solution Code: 
#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 101
#define MOD 1000000007

#define read(type) readInt<type>()

#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'
#define int long long
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}signed main(){
int N;
cin>>N;
int a[55];
int A[N];
FOR(i,N){
cin>>A[i];}
        for(int i=0;i<55;i++){
            a[i]=0;
        }

        int ans=1,p=2;
        for(int i=0;i<55;i++){
            for(int j=0;j<N;j++){
                if(ans&A[j]){a[i]++;}
            }
            ans*=p;
         //   out(ans);
        }
        ans=0;
        for(int i=0;i<55;i++){
            ans+=(a[i]*(N-a[i])*2);
            ans%=MOD;
        }
        out(ans);
}


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