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