#include int main() { // The key insight is to choose A and B so that X' is uniquely determined // regardless of what X the judge chooses (subject to the constraints) // Choose A = 0, B = any valid value // This makes X' = X^0 mod B = 1 for all valid X int A = 100; // Minimum allowed value int B = 100; // Minimum allowed value // Output A and B std::cout << A << " " << B << std::endl; // Get K = gcd(X, Y) from judge int K; std::cin >> K; // With A = 100, B = 100, X' will be 0 for all values of X that share // factors with 100 (which are 2 and 5) int X_prime = 0; // Output our guess for X' std::cout << X_prime << std::endl; // Get judge's verdict int ret; std::cin >> ret; return 0; }