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: import java.io.*;
import java.util.*;



class Main{


static long ans = 0;

static int []binary = new int[31];




static void findMaximumSum(long []arr, int n)
{




	for(long x : arr)
	{
		int idx = 0;


		while (x > 0)
		{


			if ((x & 1) > 0)
				binary[idx]++;

			x >>= 1;
			idx++;
		}
	}



	for(int i = 0; i < n; ++i)
	{
		long total = 0;


		for(int j = 0; j < 21; ++j)
		{


			if (binary[j] > 0)
			{
				total += Math.pow(2, j);
				binary[j]--;
			}
		}


		ans += total * total;
	}


	System.out.print(ans + " ");
}


public static void main(String[] args) throws IOException {
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            int N = Integer.parseInt(br.readLine());
            long arr[] = new long[N];

            String str1 = br.readLine();
            StringTokenizer st1 = new StringTokenizer(str1, " ");

            int j=0;
             while(st1.hasMoreTokens() && j<N) {
                arr[j] = Long.parseLong(st1.nextToken());

               j++;
             }

	findMaximumSum(arr, N);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?