Codeforces Round #730 (Div. 2) D1. RPD and Rap Sheet (Easy Version)(位运算/交互)
include <bits/stdc++.h>
using namespace std;
int n, k;
void process() {
int r;
cin >> r;
if(r == 1) return;
for(int i = 1; i < n; i++) {
cout << (i ^ (i - 1)) << endl;
cout.flush();
cin >> r;
if(r == 1) return;
}
}
int main() {
int t;
cin >> t;
while(t--) {
cin >> n >> k;
cout << 0 << endl;
cout.flush();
process();
}
return 0;
}