using System; public class Hello { public static void Main() { getAns(); } public static void getAns() { var ng = 1000000000; Console.WriteLine("? {0}", ng); var a = int.Parse(Console.ReadLine().Trim()); if (a == 1) { Console.WriteLine(ng); return; } var ok = 1; while (ng - ok > 1) { var mid = ok + (ng - ok) / 2; Console.WriteLine("? {0}", mid); a = int.Parse(Console.ReadLine().Trim()); if (a == 1) ok = mid; else ng = mid; } Console.WriteLine("? {0}", ok); } }