# PROBLEM LINK:

* Author:* Gourav Rathor

*Pankaj Sharma*

**Tester:***Gourav Rathor*

**Editorialist:**# Difficulty:

BEGINNER

# Prerequisites:

Basic looping, Bitwise-XOR.

# Problem:

You have given N numbers A_1 to A_N.

You have to find number of pairs for which XOR of pairs is greater than paired numbers.

# Explanation:

This is a simple bruteforce problem.

Run a program for each pair and whenever you find XOR of pair greater than both pair

integer increase the count element by one.

# Solution:

## Setter's Solution

```
#include <bits/stdc++.h>
using namespace std;
int solve(vector<int>&v)
{
int count=0,n=v.size();
for(int i=0;i<n-1;i++)
{
for(int j=i+1;j<n;j++)
{
if((v[i]^v[j])>v[i]&&(v[i]^v[j])>v[j])
count++;
}
}
return count;
}
int main() {
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<int>v(n);
for(int i=0;i<n;i++)
cin>>v[i];
cout<<solve(v)<<"\n";
}
return 0;
}
```

Please give me suggestions if anything is unclear so that I can improve. Thanks