#include #include #include using namespace std; #define N 200 int mapp[N][N]; int h; bool gotcha = false; bool isDifX(int a, int b, int c, int d){ if(mapp[a][b]*mapp[c][d] < 0){ return false; }else{ return true; } } void read(int a, int b){ cout << a << " " << b << "\n"; cout.flush(); cin >> h; mapp[a][b] = h; if(h == 0){ gotcha = true; } } int main(){ bool gottx = false; int vpx = 0; int vpy = 0; for(int y = 0; y < N; y += 4){ read(0,y); if(gotcha == true) break; for(int x = 0; x < N; x += 4){ read(x+4, y+4); if(gotcha == true) break; if(isDifX(x,y,x+4,y+4) && gotcha == false){ gottx = true; vpx = x; vpy = y; break; } if(gottx == true) break; if(isDifX(x,y,x+4,y) && gotcha == false){ gottx = true; vpx = x; vpy = y; break; }else{ read(x+4, y); if(gotcha == true) break; } } if(gotcha == true || gottx == true) break; } if(gotcha == false && gottx == true){ for(int g = 0; g < 5; ++g){ for(int k = 0; k < 5; ++k){ read(vpx+k, vpy+g); if(gotcha == true) break; } if(gotcha == true) break; } } return 0; }