For this Question: You are given an array A of N integers. You can perform the following operation as many times as you like:-
Choose two indices i and j (1 <= i < j <= N), replace A[i] by A[i] OR A[j] and replace A[j] by A[i] AND A[j]. (where OR and AND are logical operators).

All you need to do is find the maximum value of sum of squares of all integers in array A.The first line of the input contains an integer N, the number of integers in the array.
The second line of the input contains N non- negative integers of the array A.

Constraints
1 <= N <= 100000
0 <= A[i] <= 1000000Output a single integer, the maximum value for the sum of squares after performing the above defined operation.Sample Input
3
1 3 5

Sample Output
51

Explanation
Choose indices i = 2 and j = 3. A[2] = 3 OR 5 = 7, A[3] = 3 AND 5 = 1. Sum of squares of final array 1<sup>2</sup>+ 1<sup>2</sup>+7<sup>2</sup> = 51.

Sample Input
1
45

Sample Output
2025, I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define ld long double
#define int long long
#define double long double
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define pi 3.141592653589793238
const int MOD = 1e9+7;
const int INF = 1LL<<60;


const int N = 2e5+5;

// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif


void solve(){
    int n; cin>>n;
    vector<int> ct(21, 0);
    For(i, 0, n){
        int a; cin>>a;
        For(j, 0, 21){
            if(a%2){
                ct[j]++;
            }
            a/=2;
        }
    }
    int ans = 0;
    For(i, 0, n){
        int val = 0;
        For(j, 0, 21){
            if(ct[j]){
                val += (1LL<<j);
                ct[j]--;
            }
        }
        ans += (val*val);
    }
    cout<<ans;
}


signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    int t=1; 
    // cin>>t;
    while(t--){
        solve();
        cout<<"\n";
    }
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?