using System; using System.IO; using System.Linq; public class Program { public void Proc() { GetAns(0,0,100000,100000); } private void GetAns(int xMin, int yMin, int xMax, int yMax) { int xMid1 = xMin + (xMax + xMin) / 3; int yMid1 = yMin + (yMax + yMin) / 3; int xMid2 = xMax - (xMax + xMin) / 3; int yMid2 = yMax - (yMax + yMin) / 3; int[] kyori = new int[16]; for (int i = 0; i < 16; i++) { int x = xMin; if(i/4==1) { x = xMid1; } else if(i/4==2) { x = xMid2; } else if(i/4==3) { x = xMax; } int y = yMin; if(i%4==1) { y = yMid1; } else if(i%4==2) { y = yMid2; } else if(i%4==3) { y = yMax; } int tmp = Tell(x, y); if(tmp==0) { return; } kyori[i] = tmp; } int min = kyori.Min(); for (int i = 0; i < 16; i++) { if(min!=kyori[i]) { continue; } int nextXMin = xMin; int nextXMax = xMid1; if(i/4==1) { nextXMax = xMid2; } else if(i/4==2) { nextXMin = xMid1; nextXMax = xMax; } else if(i/4==3) { nextXMin = xMid2; nextXMax = xMax; } int nextYMin = yMin; int nextYMax = yMid1; if(i%4==1) { nextYMax = yMid2; } else if(i%4==2) { nextYMin = yMid1; nextYMax = yMax; } else if(i%4==3) { nextYMin = yMid2; nextYMax = yMax; } GetAns(nextXMin, nextYMin, nextXMax, nextYMax); return; } } private int Tell(int x, int y) { Console.WriteLine(x + " " + y); return int.Parse(Console.ReadLine()); } public class Reader { private static StringReader sr; public static bool IsDebug = false; public static string ReadLine() { if(IsDebug) { if(sr == null) { sr = new StringReader(InputText.Trim()); } return sr.ReadLine(); } else { return Console.ReadLine(); } } private static string InputText = @" aaaaaaa "; } public static void Main(string[] args) { #if DEBUG Reader.IsDebug = true; #endif Program prg = new Program(); prg.Proc(); } }