/* -*- coding: utf-8 -*- * * 3115.cc: No.3115 One Power One Kill - yukicoder */ #include #include #include using namespace std; /* constant */ const int MIN_X = 100; const int MAX_X = 100000; const int MOD = 1000000007; /* typedef */ using ll = long long; using vb = vector; using vi = vector; /* typedef */ /* global variables */ vb primes; vi pnums; /* subroutines */ int gen_primes(int maxp) { primes.assign(maxp + 1, true); primes[0] = primes[1] = false; int p; for (p = 2; p * p <= maxp; p++) if (primes[p]) { pnums.push_back(p); for (int q = p * p; q <= maxp; q += p) primes[q] = false; } for (; p <= maxp; p++) if (primes[p]) pnums.push_back(p); return (int)pnums.size(); } int powi(int a, int n, int mod) { // a^n % mod int pm = 1; while (n > 0) { if (n & 1) pm = (ll)pm * a % mod; a = (ll)a * a % mod; n >>= 1; } return pm; } void precalc() { int pn = gen_primes(MAX_X); for (auto p: pnums) { int a = p - 1, b = p; while (b <= MAX_X) { if (a >= MIN_X) { int y = powi(a, b, MOD); if (y % p == 0) { printf("a=%d b=%d\n", a, b); return; } } a *= p, b *= p; } } } /* main */ int main() { //precalc(); return 0; int p = 2; int a = 128, b = 256; printf("%d %d\n", a, b); fflush(stdout); int k; scanf("%d", &k); printf("%d\n", (k % p == 0) ? 0 : 1); fflush(stdout); //for (int i = 0; i < 1e9; i++); return 0; }