#include #include #include #include // Function to query the judge int query(int M, const std::vector& R) { int K = R.size(); std::cout << M << " " << K << std::endl; for (int i = 0; i < K; ++i) { std::cout << R[i]; if (i != K-1) std::cout << " "; } std::cout << std::endl; std::cout.flush(); int response; std::cin >> response; return response; } // Function to make the final guess void final_guess(int S) { std::cout << "0 1" << std::endl; std::cout << S << std::endl; std::cout.flush(); } int main() { int N; std::cin >> N; // Variables to store the sum and the counts of remainders int sum = 0; std::unordered_map remainder_count; // Using M values and querying remainder sets int M = 5; // Start with a small M for (int r = 0; r < M; ++r) { std::vector R = {r}; int count = query(M, R); remainder_count[r] = count; } // Calculate the sum based on remainder counts and M for (const auto& pair : remainder_count) { sum += pair.first * pair.second; } // Making the final guess final_guess(sum); return 0; }