using System; using System.Collections.Generic; using System.Linq; class Program { static void Main() { int StaPos = 1; int EndPos = int.MaxValue; while (true) { int MidPos = EndPos / 2; if (EndPos < int.MaxValue) { MidPos = (StaPos + EndPos) / 2; } Console.WriteLine(MidPos); int GetVal = int.Parse(Console.ReadLine()); if (GetVal == 1) { break; //StaPos = MidPos; } else { StaPos = MidPos; } } } }