#include #include #include #include using namespace std; void solve() { int n, k; cin >> n >> k; vector ret(n); iota(ret.begin(), ret.end(), 1); nth_element(ret.begin(), ret.begin() + k, ret.end(), [&](int a, int b) { cout << "? " << a << " " << b << endl; int x; cin >> x; return x == a; }); cout << "!"; for(int i = 0; i < k; i++) cout << " " << ret[i]; cout << endl; } // what would chika do // are there edge cases (N=1?) // are array sizes proper (scaled by proper constant, for example 2* for koosaga tree) // integer overflow? // are you doing geometry in floating points // have you tried rereading the problem statement int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); solve(); }