forked from satruddh/Hacktoberfest2k22
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Even_Subset_Xor.cpp
52 lines (51 loc) · 1 KB
/
Even_Subset_Xor.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include<bits/stdc++.h>
#include<vector>
#include <algorithm>
#define ll long long
#define lld long double
#define lli long long int
#define sza(x) ((int)x.size())
#define all(a) (a).begin(),(a).end()
#define vll vector<long long int>
using namespace std;
bool compare(ll a , ll b)
{
if(a>b) return true;
return false;
}
int main() {
vll temp;
for(ll i=0;i<17;i++){
for(ll j=i+1;j<18;j++)
{
for(ll k=j+1;k<19;k++){
for(ll m=k+1;m<20;m++)
{
ll ans=(1<<m)+(1<<k)+(1<<j)+(1<<i);
temp.push_back(ans);
}
if(temp.size()==1000)
{
break;
}
}
if(temp.size()==1000){
break;
}
}
if(temp.size()==1000){
break;
}
}
int tc = 0, tt = 1;
cin >> tt;
while (tc++ < tt){
ll n;
cin>>n;
for(ll i=0;i<n;i++){
cout<<temp[i]<<" ";
}
cout<<endl;
}
return 0;
}