```
#include<vector>
#include<cmath>
#include <iostream>
using namespace std;
long long int diff(long long int a,long long int b)
{
long long int fakea=a,fakeb=b;
vector <long long int>num1,num2;
while(a)
{
if(a&1)
num1.insert(num1.begin(),1);
else
num1.insert(num1.begin(),0);
a=a>>1;
}
while(b)
{
num1.insert(num1.begin(),b&1);
b=b>>1;
}
while(fakeb)
{
num2.insert(num2.begin(),fakeb&1);
fakeb=fakeb>>1;
}
while(fakea)
{
num2.insert(num2.begin(),fakea&1);
fakea=fakea>>1;
}
/*************************************XXxxxxXXXXXXXXXXxxxxxxXXXXXX********************/
long long int ans=0;
long long int x=0,y=0,k=1;
for(int i=num1.size()-1;i>=0;i--)
{
x+=num1[i]*k;
k*=2;
}
for(int i=num2.size()-1,k=1;i>=0;i--)
{
y+=num2[i]*k;
k*=2;
}
ans=x-y;
return ans;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int t;cin>>t;
while(t--)
{
int n;cin>>n;
long long int arr[n];
for(int i=0;i<n;i++)
cin>>arr[i];
long long int max= 0;
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(max<diff(arr[i],arr[j]) )
{
max=diff(arr[i],arr[j]);
}
}
}
cout<<max<<endl;
}
return 0;
}
```

Link to the problem : https://www.codechef.com/problems/BINFUN

my code is not generating the binary for big numbers ie value of x is not correct.

solving only for partial points right now