#include #include #define MAX 2000000 bool state[MAX]; int main() { memset(state, 0, sizeof(state)); state[2] = true; printf("%d %d\n", 0, 1); int u = 1; int n = 1; for (int w=1; 2+w=0; k--) { state[2+k] = state[k] ^ (state[1+k] | state[2+k]); if (state[2+k]) { if (u==nz) { found = true; } nz = 0; } else { nz++; } } if (found) { printf("%d %d\n", u, n); fflush(stdout); u++; } } return 0; }