File size: 1,009 Bytes
1fd0050
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#include <bits/stdc++.h>
using namespace std;

vector<int> do_query(const vector<int>& seq) {
  if (seq.empty()) return {};
  int L = seq.size();
  cout << L;
  for (int u : seq) cout << " " << u;
  cout << '\n';
  cout.flush();
  vector<int> res(L);
  for (int& r : res) cin >> r;
  return res;
}

void output_guess(const vector<int>& perm) {
  cout << -1;
  for (int u : perm) cout << " " << u;
  cout << '\n';
  cout.flush();
  exit(0);
}

int main() {
  int subtask, n;
  cin >> subtask >> n;
  int target_k = (n <= 1000 ? n / 4 : 2000);
  vector<int> labels(n);
  for (int i = 0; i < n; i++) labels[i] = i + 1;
  vector<int> II;
  int s = max(1, n / 20);
  int num_orders = 5;
  vector<int> curr_I;
  int start_pos = 0;
  while (start_pos < n) {
    int bs = min(s, n - start_pos);
    vector<int> batch(labels.begin() + start_pos, labels.begin() + start_pos + bs);
    vector<int> test_seq;
    for (int u : batch) {
      test_seq.push_back(u);
      test_seq.push_back(u);
    }
    auto test_rep = do